Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

Display and write in file in one echo command

Shell Programming and Scripting


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 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 Unix and Linux 06-16-2011
panyam panyam is offline Forum Advisor  
Registered User
 
Join Date: Sep 2008
Last Activity: 1 February 2016, 7:31 AM EST
Posts: 1,160
Thanks: 20
Thanked 105 Times in 100 Posts

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

Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 06:36 PM.