Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting Output to Console & Log

Status
Not open for further replies.

slgordon

IS-IT--Management
Sep 27, 2000
57
US
Does anyone know how to redirect the output, of a backup for example, to the console and to a log file?
I have tried redirecting it to a log and then doing a
tail -f on the log to display it on the console but I don't
want my operators to have to hit "ctrl-c" when the backup is done.
Thanks in advance!
 
If you want to redirect STDOUT from a command to two places you can use [tt]tee[/tt]:
[tt]
command | tee outfile
[/tt]
tee will copy its output to standard output and to each named file in its arguments.... you can use the [tt]-a[/tt] to append to each named file...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top