Scott Miller
Scott Miller

Reputation: 27

contents of a file copied multiple times

copy contents of a file into all files of certain name.

using Linux command line.

cp myfile.txt old_file_a
cp myfile.txt old_file_b
cp myfile.txt old_file_c

for i in old_file* do; cp myfile.txt $i; done?

Upvotes: 0

Views: 150

Answers (1)

timgeb
timgeb

Reputation: 78690

for i in a b c; do cp myfile.txt old_file_$i; done

Upvotes: 1

Related Questions