![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to print script output to screen and file | orahi001 | UNIX for Dummies Questions & Answers | 4 | 04-21-2008 11:56 AM |
| echo to both screen and a file | phamp008 | Shell Programming and Scripting | 6 | 01-16-2008 11:48 PM |
| perl - print to a log file and screen | mjays | Shell Programming and Scripting | 6 | 08-21-2007 05:34 AM |
| print to screen and to file using awk?! | satnamx | Shell Programming and Scripting | 2 | 04-25-2006 10:33 AM |
| is it possible to echo 'some text' every 10 minutes on my screen | vkandati | UNIX for Dummies Questions & Answers | 1 | 03-08-2005 02:38 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
echo or print to screen and file
I did a search for this topic but I couldn't find it and I was sure I have seen something similar before (hard because I am not sure of the criteria for the keywords)
What I was looking for was to be able to echo a message to the screen from a bash.sh script at the same time logging it to a file. So far I have been duplicating the line twice, one to the screen, one to the file. Any suggestions? ie echo "Warning: file $USR on $tdate" echo "Warning: file $USR on $tdate" >/logfile.log |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Look into the tee command. ($ man tee)
That might help you out. |
|
#3
|
|||
|
|||
|
thanks
thats exactly what I was looking for.
|
|||
| Google The UNIX and Linux Forums |