Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

append lines from a text file

Status
Not open for further replies.

preethib

Programmer
Jul 20, 2000
39
IN
Hi,

Is there a single system/awk/sed command, if I want to append a file to a list of exzisting configuration files.

I have 10 lines in a 1 text file, that I want to append to the contents of 10 existing files.

Any help would be great.

Thanks,
 
Hi:

The append operator >> will do what you want:

Given:
config1.file # configuration file
atext.file # file to append

cat atext.file >> config1.file

You can write yourself a small script like this

for i in config1.file config2.file # ... up to howmany files
do
cat atext.file >> $i
done

Regards,


Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top