Shell : quick newb question - redirecting to file

Patricia Fraser trish at thefrasers.org
Tue Jul 12 11:20:52 UTC 2005


Hi Vince,

> It does start Yelp, and print loads of stuff in the terminal window,
> and it does create the 'yelp.strace' file, but, once I quit
> Yelp/strace, and go to have a look at the result, the text file is
> empty... zero byte :-/

Your problem is that strace outputs to standard error, and not
standard out. Use "strace yelp 2> yelp.strace" instead.
The 2> says pipe the output of standard error to the file strace.txt
instead of the output of standard out. The reasion for using standard
error is that you can then see the normal program output on the screen,
when the trace information is going to a file.

Cheers,

-- 
Trish Fraser, Sunbury, Australia
di jul 12 21:19:44 EST 2005
GNU/Linux 1997-2004 #283226 counter.li.org
andromeda up 6 day(s), 0 hour(s), 52 min, 37 sec
kernel 2.6.11-6mdk
--




More information about the ubuntu-users mailing list