cd /home/foo/
for f in `seq -w 01 10`
do
cat $f > /home/foo/cloned_files/"$f".$i
done
situation: i have only 1 file in /home/foo. i want to clone that file 10 times and add the iteration number to the filename. in the end, i should have 10 files identical in content but with a suffix indicating its sequence number.
example: /home/foo/xfile.txt
after executing the script, i should have: xfile.txt.01, xfile.txt.02, xfile.txt.03...xfile.txt.10 in /home/foo/cloned_files/
any help would be much appreciated. thank you