Re: how do i..
From: Robert Locke (rlocke_at_ralii.com)
Date: 08/23/04
- Previous message: Alexander Dalloz: "Re: FTP Binary , ASCII"
- In reply to: Mr. Oberoi: "how do i.."
- Next in thread: Mr. Oberoi: "Re: how do i.."
- Reply: Mr. Oberoi: "Re: how do i.."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Alexander Dalloz: "Re: FTP Binary , ASCII"
- In reply to: Mr. Oberoi: "how do i.."
- Next in thread: Mr. Oberoi: "Re: how do i.."
- Reply: Mr. Oberoi: "Re: how do i.."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|