Re: Linux sys vars?

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: Kevin Fries
Date:  
To: Main PLUG discussion list
Subject: Re: Linux sys vars?
On 05/12/2011 02:34 PM, keith smith wrote:
> What is the number 1 and 2? Is there others?
>


These are not variables, they are file handles.

0 = Standard In
1 = Standard Out
2 = Standard Error

If you want all errors to be sent to Standard Out instead of Standard
In, append your command with 2>&1. This way, you can pipe the output
through something like tee, more, less, or redirected to a file.

side note, if you want both stdout and stderr both redirected to a file,
say /tmp/output.txt, you can do that with a command &>/tmp/output.txt

Hope this helps
Kevin
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss