Simple 'echo' question


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Simple 'echo' question
# 1  
Old 02-04-2009
Simple 'echo' question

Hi,

I would like to output the identical line to 2 text files, ie

output='blah'
echo $output > test1.txt
echo $output > test2.txt

Is there a way I could do that output with ONE command, ie

output='blah'
echo $output > test1.txt & test2.txt (I know that doesn't work)

Thanks for any help.
Mike
# 2  
Old 02-04-2009
Code:
echo $output | tee >test1.txt test2.txt

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Syslog.conf: looking for a simple answer on a simple question

Cheers! In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not? To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 Replies

2. Shell Programming and Scripting

need simple echo question

Hi I want to use echo command as below echo 'dir=' $1 ' dir|file|home' i need output like below : echo 'dir=' $1 ' dir|file|home' pp13dff Output dir=pp13dff dir|file|home (4 Replies)
Discussion started by: asavaliya
4 Replies

3. Shell Programming and Scripting

Simple cat and echo question

Apologies, probably a really simple problem: I've got a text file (nh.txt) with this in it: user1 email1 email2 user2 email1 email2 etc With the following basic script: for tline in $(cat nh.txt) do echo "**********" echo $tline done ... (3 Replies)
Discussion started by: nelmo
3 Replies

4. Shell Programming and Scripting

Simple echo problem

Hey all! I'm in an intro to UNIX class at university, and we've just began writing scripts. Naturally I can't get it to do what I want. Basic script as follows: COMPARE1=`ls|wc -l` tar czf archive.tgz ~/path/to/file COMPARE2=`tar tvzf archive.tgz|wc -l` if then ... (7 Replies)
Discussion started by: nickzourdos
7 Replies

5. Shell Programming and Scripting

"Simple" echo/reading variable question...

Hello, I have a simple(I think) question! Although simple, I have been unable to resolve it, so I hope someone can help! OK, here it is: 1)I have an awk script that prints something, such as: awk '{print $2}' a > x so x might hold the value of say '10' 2)Now, I just want to check to see if... (4 Replies)
Discussion started by: astropi
4 Replies

6. UNIX for Dummies Questions & Answers

echo * question

Hi all and tks in advance I am working my way through 'Learning the bash Shell'. I cannot be sure if I really understand why "echo *" (my double quotes) returns all the files in the current directory. I get the * ( wildcard) expansion of "*", and I think I understand that "echo" returns it's... (5 Replies)
Discussion started by: mdeh
5 Replies

7. Shell Programming and Scripting

With that logic this echoes "echo". Question about echo!

echo `echo ` doesn't echoes anything. And it's logic. But echo `echo `echo ` ` does echoes "echo". What's the logic of it? the `echo `echo ` inside of the whole (first) echo, echoes nothing, so the first echo have to echo nothing but echoes "echo" (too much echoing :P):o (2 Replies)
Discussion started by: hakermania
2 Replies

8. Shell Programming and Scripting

Echo question

How can I get the following to prompt me for new values for the dacsrtrspans? example I want to change the span #, sinktermmod, sinktermport, srctermdev and srctermport to new values. old: ADD DACSRTRSPAN-1-840 SINKTERMMODULE=8 SINKTERMPORT=94 SRCTERMDEV=1 SRCTERMPORT=1 SPANTYPE=T1_2... (0 Replies)
Discussion started by: tadzooks
0 Replies

9. Shell Programming and Scripting

An echo question

Why do get 0 when i enter " echo $? " (1 Reply)
Discussion started by: JamieMurry
1 Replies

10. UNIX for Dummies Questions & Answers

Ok simple question for simple knowledge...

Ok what is BSD exactly? I know its a type of open source but what is it exactly? (1 Reply)
Discussion started by: Corrail
1 Replies
Login or Register to Ask a Question