tee and some commands
On Tue, 22 Mar 2011, Leo "TheHobbit" Cacciari wrote:
>
> Hi chaps
>
> Â*
>
> Anyone noticed that tee doesnʼt seem to log the output from some commands to a
> log file?
>
> Â*
>
> I am using tee in a script on the following line;
>
> Â*Â*Â* ncftpput -u $ftp_user -p $ftp_pass -R -m -v ftp.mydomain.local /
> $dest/archives/$1/ | tee -a $out_file
it's entirely possible that what's coming out of the previous
command is being sent to stderr, whereas only stdout is passed
through a pipe by default.
if you want both stdout and stderr to be processed by the pipe, use
the following:
blah blah 2>&1 | going here
the "2>&1" forces stderr to follow stdout, at which point both streams
go to the pipe.
rday
--
================================================== ======================
Robert P. J. Day Waterloo, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
================================================== ======================--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
|