The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
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

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-09-2002
Shakey21
Guest
 

Posts: n/a
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  
Old 01-09-2002
Cameron's Avatar
Registered User
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 490
Look into the tee command. ($ man tee)
That might help you out.
  #3  
Old 01-09-2002
Shakey21
Guest
 

Posts: n/a
thanks

thats exactly what I was looking for.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:58 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0