Any way to split up STDOUT and STDERR, and then recombine in the right order?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Any way to split up STDOUT and STDERR, and then recombine in the right order?
OK, the question may be a bit misleading, so here is what I am trying to do:
I have a bunch of jobs in cron, and I would like all the output to eventually end up in a log file in exactly the order it would come out if run interactively.
However, I would like to somehow mark the lines that come out via STDERR so that I can say color them or something so I can pick them out more easily. This may be as simple as prepending some predetermined series of characters to all STDERR lines like @@@@@ or such.
Does separate out STDERR and STDOUT, but it doesn't reassemble them in the right order; the STDERR: lines are all at the bottom of the file. I'd like all the lines to be in the same order as emitted.
OK, there HAS to be a way to do this, because I got the idea from emacs. In our implementation here, when you issue a command, stdout and stderr both go to the console, but stdout is the default font color, and the stderr stuff is another color. I just want to replicate this for an HTML page to view cron job status.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.