on redirecting with 2>&1|tee yourlog.log
René L. Reingard
reingard at hispeed.ch
Thu Jul 14 19:53:59 UTC 2005
Am Thu, 14 Jul 2005 17:55:50 +0200 schrieb Tory Patnoe <tpatnoe at qwest.net>:
>> René L. Reingard wrote:
>> hello shell experts
>> if this is a parameter for getting a Logfile created (software name is
>> bdc), then how to put it into a working command ($ bdc --log ?????).
>> i had some tries but did not got it.
> I may be misreading the question but this sounds like simple shell
> redirects. If you want to log the output of the bdc command then run:
> bdc >& yourlog.log
> The ">&" syntax tells the shell to redirect stdout and stderr from bdc
> to yourlog.log. Use ">" for stdout only.
> If you want to see the output to the terminal as well as to a log file
> use tee:
> bdc 2>&1 | tee yourlog.log
> The "2>&1" tells the shell to redirect stderr (2) to the same streams as
> stdout (1). The "|" syntax tells the shell to redirect the stdout to the
> tee command.
thanks for that.
first command is running well, and so i did the script now.
unfortunately the second idea is not working. there is no output on the
screen at all eventhough the output into the LOG is still working.
anything more to tell?
More information about the ubuntu-users