HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to catch the warning/error messages on the...
Operating System - HP-UX
1837984
Members
2693
Online
110124
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
03-11-2002 04:11 PM
03-11-2002 04:11 PM
Hello there,
When I run script files (or makefiles), sometimes I got warning/error messages on the screen. How to catch those messages? I tried
to use '>' and '>>' to direct a file but it
did not work.
The info is very much appreciated.
Reggie
When I run script files (or makefiles), sometimes I got warning/error messages on the screen. How to catch those messages? I tried
to use '>' and '>>' to direct a file but it
did not work.
The info is very much appreciated.
Reggie
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2002 04:16 PM
03-11-2002 04:16 PM
Re: how to catch the warning/error messages on the screen
By convention, those do not go to stdout but rather to stderr.
Suppose that your command/script is called myfile.sh,
myfile.sh > mylogfile 2>myerrfile
That would output the normal messages (stdout) to mylogfile and the errors (stderr) to myerrfile.
If all you want are the errors,
myfile.sh 2>myerrfile.
If you want to send both stdout and stderr to the same file:
myfile.sh > mylogfile 2>&1
Regards, Clay
Suppose that your command/script is called myfile.sh,
myfile.sh > mylogfile 2>myerrfile
That would output the normal messages (stdout) to mylogfile and the errors (stderr) to myerrfile.
If all you want are the errors,
myfile.sh 2>myerrfile.
If you want to send both stdout and stderr to the same file:
myfile.sh > mylogfile 2>&1
Regards, Clay
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2002 04:18 PM
03-11-2002 04:18 PM
Re: how to catch the warning/error messages on the screen
Hi,
If you are using the default shell to redirect the standard error also you should use 2> filename or 2>&1 to redirect both in the same filename.
For example:
command > filename 2>&1
will redirect all output of command to the file name filename
and
command > filename 2> filename2
will redirect the standard output to filename and the error messages to filename2.
Luc
If you are using the default shell to redirect the standard error also you should use 2> filename or 2>&1 to redirect both in the same filename.
For example:
command > filename 2>&1
will redirect all output of command to the file name filename
and
command > filename 2> filename2
will redirect the standard output to filename and the error messages to filename2.
Luc
La réponse est le malheur de la question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2002 04:35 PM
03-11-2002 04:35 PM
Solution
Hi,
If you wish to collect all messages that are displaying on your terminal screen you can use the script command. It will display all commands and output of these which display on your screen into a text file.
# script /tmp/myoutput
# command x
# command y
controlD to finish
HTH
-Michael
If you wish to collect all messages that are displaying on your terminal screen you can use the script command. It will display all commands and output of these which display on your screen into a text file.
# script /tmp/myoutput
# command x
# command y
controlD to finish
HTH
-Michael
Anyone for a Mutiny ?
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP