- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Redirect a message or log to console
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
12-07-2005 02:39 AM
12-07-2005 02:39 AM
how do i do it?
is like:
echo "hi" > /dev/console ??
Thanks, Manuales
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2005 02:49 AM
12-07-2005 02:49 AM
Solutionmyscript > /dev/console 2>&1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2005 02:51 AM
12-07-2005 02:51 AM
Re: Redirect a message or log to console
Try it. It won't hurt anything.
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
12-07-2005 03:06 AM
12-07-2005 03:06 AM
Re: Redirect a message or log to console
with this line:
myscript > /dev/console 2>&1
i can't understand: 2>&1
thanks, Manuales
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2005 03:14 AM
12-07-2005 03:14 AM
Re: Redirect a message or log to console
# myscript > /dev/console 2>&1
...says to redirect the standard output (STDOUT or file descriptor #1) of 'myscript' to /dev/console. Then, to that, duplicate the output of standard error (STDERR or file descriptor #2) to whatever STDOUT points.
See the manpages for 'sh-posix' in the section titled "Input/Output" for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2005 03:28 AM
12-07-2005 03:28 AM
Re: Redirect a message or log to console
myscript > /dev/console 2>&1
i can see all messages of script executed in /dev/console as much messages as errors?
thanks, Manuales.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2005 03:32 AM
12-07-2005 03:32 AM
Re: Redirect a message or log to console
Yes. As Clay noted, good software writes error and warning messages to STDERR and its other output to STDOUT. The redirection shown pushes *both* those streams to the same place --- the console in this case.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2005 04:49 AM
12-07-2005 04:49 AM
Re: Redirect a message or log to console
Its redirecting , stdout and stderr together with ">&"
2>&1 is :
2 for standard error. stderr.
1 for standard output. stdout.
Cheers,
Raj.