Re: how do i..

From: Robert Locke (rlocke_at_ralii.com)
Date: 08/23/04

  • Next message: Alexander Dalloz: "Re: Fw: Network configuration probelms (still)"
    To: For users of Fedora Core releases <fedora-list@redhat.com>
    Date: Sun, 22 Aug 2004 19:02:23 -0400
    
    

    On Sun, 2004-08-22 at 18:31, Mr. Oberoi wrote:
    > I see people still going on about my "five mistakes" mail... I am over
    > it and willing to learn so could any one tell me how do i save the
    > error results from the program(shell script) to a file. when i tried
    > using pipe it only saves first line and rest of the mistakes get
    > displayed on the screen! why is that and how can i fix it?
    > thanks
    >
    >
    > deepak oberoi
    >
    Deepak,

    There are two output channels, stdout and stderr. You may redirect each
    by doing the following:

    scriptname > file1 2> file2

    file1 will then contain the normal output from the script and file2
    would contain any error output.

    You can combine the output to a single file by doing the following:

    scriptname > filename 2>&1

    or

    scriptname &> filename

    In both cases, both standard output and error output will be redirected
    to filename.

    The one danger is that this form of redirection will overwrite the
    file. You can also do a pair of >> to "append" if the file already
    exists.

    BTW, the pipe character is used to "chain" the output of the command on
    the left of the pipe as input to the command on the right of the pipe.

    HTH,

    --Rob

    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Alexander Dalloz: "Re: Fw: Network configuration probelms (still)"

    Relevant Pages

    • Re: tail -f with the Bell sound
      ... I have written a script with tail -f filename | grep `xxx xx` and I ... I am not sure if I can pipe the awk again after the grep. ...
      (comp.unix.shell)
    • Re: tail -f with the Bell sound
      ... I have written a script with tail -f filename | grep `xxx xx` and I ... I am not sure if I can pipe the awk again after the grep. ...
      (comp.unix.shell)
    • accessing a pipe from TCL and C, hang in `close/exit
      ... I have a TCL shell script which opens a socket to some remote host, ... and opens a read-converter pipe. ... data arrives on the remote host. ... Now I want to close the channel from C++: ...
      (comp.lang.tcl)
    • I can process my mail!
      ... I figured out how to pipe mail to my own scripts! ... the script as an argument. ... that won't confuse boundaries for message text. ... sendmail, but I'm not that interested in sendmail in particular. ...
      (comp.unix.questions)
    • Re: IO::Pipe and loss of data
      ... May be I cut too much, but as the last run of my big script was ... > show at least how I work to send a message and use the pipe. ... There is a fixed amount of buffer (probably 4K ... for each "server". ...
      (comp.lang.perl.misc)