HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shell question (intercept stderr output)
Operating System - HP-UX
1838661
Members
10338
Online
110128
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
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-2003 09:43 AM
03-11-2003 09:43 AM
shell question (intercept stderr output)
A background process sends messages via stderr to the terminal. How can I duplicate this output to stdout (or elsewhere), so that another process can read the messages, too?
my_prog 2>&1 1>results | tee msgfile 1>&2 |&
with periodic inspection of msgfile works, but is slow. Is there a better way? Thanks in advance for your help.
my_prog 2>&1 1>results | tee msgfile 1>&2 |&
with periodic inspection of msgfile works, but is slow. Is there a better way? Thanks in advance for your help.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2003 10:16 AM
03-11-2003 10:16 AM
Re: shell question (intercept stderr output)
Hi
1. How about:
mkfifo msgfifo
and than something like
my_prog 2>msgfifo
or more complicated construction with this?
Disadvantage: 'writes' to fifo are blocked until the reader is attached.
2. tail -f msgfile
scans every second a file and prints only what was appended after previous scan.
Good luck
Adam
1. How about:
mkfifo msgfifo
and than something like
my_prog 2>msgfifo
or more complicated construction with this?
Disadvantage: 'writes' to fifo are blocked until the reader is attached.
2. tail -f msgfile
scans every second a file and prints only what was appended after previous scan.
Good luck
Adam
I do everything perfectly, except from my mistakes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2003 10:16 AM
03-11-2003 10:16 AM
Re: shell question (intercept stderr output)
Here is an offbeat idea, probably not the best
In another terminal session, run this.
tail -f msgfile
It will show output as it hits the file.
I am sure there is some slick way to do it on the command line, but my way is simple and it would work unless I'm logged in on a console.
SEP
In another terminal session, run this.
tail -f msgfile
It will show output as it hits the file.
I am sure there is some slick way to do it on the command line, but my way is simple and it would work unless I'm logged in on a console.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
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