rewrite the same info in 3 different files

i would like to be able rewrite the same info in 3 different files

/path/file1.ext
/path/file2.ext
/path/file3.ext

can u help me please with shell script ?

lets say i want to write "12345"

thanks

I'm sure there's a lot of ways to do this...

command > file1.ext
cp file1.ext file2.ext
cp file1.ext file3.ext

You can also try using the tee command, but it may only work on the C shell.

To write to the files:
command | tee file1.ext file2.ext file3.ext

To append to them:
command | tee -a file1.ext file2.ext file3.ext

If perl is anygood to you.

Yeah, that Perl script would work too. And if you want to append, use >> instead of > so that the data in the file doesn't get written over.

perleo, you really don't need $file1 = FILE1, $file2 = FILE2, etc.. you can just use the filehandles FILE1, FILE2 and FILE3 in the print command.

This sounds vague enough to possibly be homework...

What do you have written so far? What shell? Why do you need it in 3 different files? How is the information stored (in a varible, a disk file, coming in from a pipe)?

the perl one is good enough

thanks alot

i just got 8 .htaccess files with my ip listed in to it
and now i have a new ip almost every month.....