Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 09:09 PM
06-25-2003 09:09 PM
2>&1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 09:14 PM
06-25-2003 09:14 PM
Re: 2>&1
Just sending the output someplace other than the terminal.
You'll see it a lot in crontab sends stdout and stderr where you want it.
I commonly use it in combination with mailx to get cron jobs to email people
From the book
0 is standard input (usually a keyboard, can be a file)
1 is standard output
2 is standard error
2>&1
redirect standard error to standard output.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 09:15 PM
06-25-2003 09:15 PM
Re: 2>&1
Page 70 of the Raqeef manual:
2>&1 send stderr and stdout to the same file.
For me. I either direct to a regular file or to mailx -s "subject" recipient.
Sorry it took two posts. duh.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 09:22 PM
06-25-2003 09:22 PM
Re: 2>&1
It is output re-direction of either stdout or stderr. A very useful way of using this is in crontab.
Regards
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 09:32 PM
06-25-2003 09:32 PM
Re: 2>&1
First, please make sure that "1>" equal to ">", that means standard output! And "2>" means standard error!
For "2>$1" means the output of stderr just the same as stdout!
Normally, standard output is the terminal!
For example:
#ls >/tmp/dir.txt 2&>1
This will output the stdout & stderr to /tmp/dir.txt both!
-ux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 09:39 PM
06-25-2003 09:39 PM
Re: 2>&1
The ">" sign is used for redirecting the output.
and
2=standard error
1=standard output
0=standard input
when used with the scripts you can use either way to redirect the output and error either to standard out put or to a file.
when 2>&1 is used with a filename you are redirecting the output and error both to that file.
Cheers
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 11:18 PM
06-25-2003 11:18 PM
Re: 2>&1
to add to the above replies,
In my crontabs, i prefer to use:
1>/home/yd/logfiles/output-myscript.crn 2>/home/yd/logfiles/error-myscript.crn
instead of:
1> /home/yd/logfiles/both-myscript.crn 2>&1
hope this helps!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 03:35 AM
06-26-2003 03:35 AM
Re: 2>&1
Redirect the standard ERROR to the standard OUTPUT, useful for logging when you want to
save the errors.
Caesar