- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Redirect stderr
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
04-04-2004 10:30 PM
04-04-2004 10:30 PM
Redirect stderr
I have a problem with disks and when I enter vgdisplay an error is displayed. I would like to capture that error so I make:
[comand] > /tmp/outputfile 2>&1
...but I get nothing in /tmp/outputfile. I continue to see the error message only in display...can't capture it....
Am I doing something wrong?
Thanks in advance
SN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 10:36 PM
04-04-2004 10:36 PM
Re: Redirect stderr
What is the type of shell you are working in ?
Simply try this
command > /tmp/outputfile.
OR
command >> /tmp/outputfile.
this should work.
Regs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 10:36 PM
04-04-2004 10:36 PM
Re: Redirect stderr
no space if you have any !
Regards,
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 10:43 PM
04-04-2004 10:43 PM
Re: Redirect stderr
command >> command.out 2>&1
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 10:45 PM
04-04-2004 10:45 PM
Re: Redirect stderr
If all redirection fail, I've seen that, use exec to redirect you stty to a file, don't forget to retsore it after.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 10:46 PM
04-04-2004 10:46 PM
Re: Redirect stderr
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 10:50 PM
04-04-2004 10:50 PM
Re: Redirect stderr
You should do it in the following way
command 2>&1 /tmp/outputfile
This will work for you
With best wishes
Naveej
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 10:56 PM
04-04-2004 10:56 PM
Re: Redirect stderr
I just did "vgdisplay > output" on our cluster which produces errors to the screen and normal output to the file "output" as you would expect. Then "vgdisplay > output 2>&1" sent all output, including the errors to file "output", again as expected.
Is your [command] vgdisplay or is it something else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 11:17 PM
04-04-2004 11:17 PM
Re: Redirect stderr
Try this it is working.....
[command] 2>&1 /tmp/outputfile
---
vgdisplay 2>&1 /tmp/outputfile
"vgdisplay 2>&1 /tmp/outputfile"
If u want error on different file, u can also do like this. This will put output into /tmp/outputfile and error in to /tmp/errorfile.
vgdisplay > /tmp/outputfile 2> /tmp/errorfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 11:29 PM
04-04-2004 11:29 PM
Re: Redirect stderr
So...stupid me was making a big mistake...making a grep before redirecting stderr. Sorry, after all it works as it should ([comand] > /tmp/outputfile 2>&1).
Thanks for the answers nevertheless.
Regards
SN