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.
I'm new to linux, and am writing a bash script to automate the ripping/encoding process to backup my cd collection. My script is working very well. One thing I would like to add is the ability to add the cdparanoia version number to my log file. I know cdparanoia hasn't been updated in years, but this is more for learning than anything. I can't seem to capture the output of "cdparanoia -V". Even when I try to pipe it to a var in my script, it seems to print to the console no matter what. Am I doing something wrong?
But why would (what seems to be) standard output be stderr?
It's not unusual for scripts/apps to send messages to stderr instead of stdout - particularly where a "normal" exit means no output and a "0" status returned.
As far as why they look like the same thing goes, that just means that the current location for stdout was the same as for stderr. Try running ls -l /dev/stdout and ls -l /dev/stderr from a terminal and following the links. On the ssh window I have open at the moment, the output is:
Code:
$ ls -l /dev/stdout
lrwxrwxrwx 1 root root 4 2006-08-04 11:00 /dev/stdout -> fd/1
$ ls -l /dev/stderr
lrwxrwxrwx 1 root root 4 2006-08-04 11:00 /dev/stderr -> fd/2
$ ls -l /dev/fd/1
lrwx------ 1 steve steve 64 2006-08-04 13:06 /dev/fd/1 -> /dev/pts/3
$ ls -l /dev/fd/2
lrwx------ 1 steve steve 64 2006-08-04 13:06 /dev/fd/2 -> /dev/pts/3
The final location is the same (/dev/pts/3) so stdout and stderr will both display there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.