- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: jumbled stdout and 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
02-10-2004 05:08 PM
02-10-2004 05:08 PM
jumbled stdout and stderr.
We have a script that redirects a command's stdout and the stderr output onto a file.
via. [cmd] > $tmpfile 2>&1
The tmpfile location is declared earlier in the script.
I understand that in such a case the stdout and stderr entries are always separated by newline
-----------------
stdout_entries
stderr_entries
-----------------
Now, my question -
1. can there be a case when both the stdout and stderr entries exist in the same line i.e. stdout_entrystderr_entry
2. One of our partners is getting such a state on his system, erratically though. Can this be by any chance be an indication of system's health?
Thanks,
Sanjay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2004 05:26 PM
02-10-2004 05:26 PM
Re: jumbled stdout and stderr.
In other words, the OS does not put a newline at the end of each line being written to the file, the application writing to it does. If the application doesn't put a new line at the end of a line then lines will get "jumbled up".
Generally what probably isn't happening is that the stdout and stderr are getting mixed up unless, two applications are writing to the same file and both have set non-blocking mode on (and probably a few more options too). I suspect that isn' the case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2004 05:44 PM
02-10-2004 05:44 PM
Re: jumbled stdout and stderr.
So in my case, the application in question would be the cmd whose stdout and stderr is being redirected to the temp file.
Very well, I follow this lead as well.
Thanks,
Sanjay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2004 05:55 PM
02-10-2004 05:55 PM
Re: jumbled stdout and stderr.
Interestingly, perl doesnt so if you have any perl involved in this story, I'd look there first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2004 12:02 AM
02-11-2004 12:02 AM
Re: jumbled stdout and stderr.
what about this?
[cmd] 2>&1 | awk '{print $0}' > $tmpfile
Michael