Display and write in file in one echo command | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Display and write in file in one echo command

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-16-2011
vivek1489 vivek1489 is offline
Registered User
 
Join Date: Oct 2010
Last Activity: 30 May 2012, 9:16 AM EDT
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Display and write in file in one echo command

Hi All,
I want to display content on command promt and also write in file.
For that iI ahve to write two sentence
echo "XXXXXXX"
echo "XXXXXXXX" >> 1.txt

Is there any way to write in one echo statement
Sponsored Links
    #2  
Old 06-16-2011
panyam panyam is offline Forum Advisor  
Registered User
 
Join Date: Sep 2008
Last Activity: 24 July 2014, 3:48 AM EDT
Posts: 1,156
Thanks: 20
Thanked 104 Times in 99 Posts

Code:
 
echo "XXXXXXXX"  | tee 1.txt
 
man tee

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
echo display problem aishsimplesweet Shell Programming and Scripting 2 02-04-2011 09:42 AM
Need a Command To display "echo command value in loop" in single line. sakthifire Shell Programming and Scripting 2 03-04-2009 08:49 AM
echo command and file I/O Redirection userix Shell Programming and Scripting 8 05-11-2008 05:08 PM
what does echo $$ command display suri Shell Programming and Scripting 2 03-06-2007 02:01 AM
Display from a variable using echo. jagannatha UNIX for Dummies Questions & Answers 4 06-12-2003 03:38 PM



All times are GMT -4. The time now is 02:11 PM.