Re: exec question

From: Chris Gregors (Chris.Gregors_at_TELUS.COM)
Date: 09/25/03

  • Next message: Bill Verzal: "Re: exec question"
    Date:         Thu, 25 Sep 2003 08:15:14 -0600
    To: aix-l@Princeton.EDU
    
    

    How about running the exec as a sub-shell?

    echo "got here"
    ( exec ls >logfile 2>erfile )
    echo "now got here"

    -----Original Message-----
    From: Bill Verzal [mailto:BVerzal@KOMATSUNA.COM]
    Sent: Thursday, September 25, 2003 8:02 AM
    To: aix-l@Princeton.EDU
    Subject: exec question

    Probably a simple question, but I'm at a loss. Google has offered some suggestions, but nothing helps.

    I have a script that does an "exec 1>filename 2>fileerr".

    After the task finishes, how do I re-open stdout and stderr again so I can print stuff on the screen (such as end times and stuff) ?

    Thanks, Bill.
    --------------------------------------------------------

    Bill Verzal
    AIX Administrator, Komatsu America
    (847) 970-3726 - direct
    (847) 970-4184 - fax


  • Next message: Bill Verzal: "Re: exec question"

    Relevant Pages

    • Re: Katrina Leveled our home
      ... Words fail, but I wanted you to know I'm truly sorry to learn of your loss. ... I'm sure many others will echo this sentiment. ...
      (rec.gambling.poker)
    • Re: Variable problem in script while loop
      ... As to how to do the same thing without starting a new sub-shell, ... final Entries: an_entry an_xref ... Notice that only the final echo ...
      (alt.os.linux.suse)
    • Re: Sad news for me
      ... Wow Echo. ... My prayers for your friend. ... And I am saddened for your loss. ...
      (alt.support.stop-smoking)
    • Re: differences in "read" builtin behaviour
      ... > Pipe is executed in sub-shell. ... So, 'read' is in subshell, while ... > 'echo' is in parent shell. ...
      (comp.unix.shell)
    • Re: exec question
      ... echo "This is statement #1" ... exec>file1 2>file2 ... sapcws:/tmp>more file1 ... Subject: exec question ...
      (AIX-L)