Hi,
Found lots of stuff that is close but no cigar...
I have a file ie. a.txt, and I want to copy it to another directory 5000 times and call it:
a1.txt
a2.txt
...
a5000.txt
Struggling to put a loop together in this new world of AIX. please include full script for me to understand and learn from.
Thanks in advance
Terry
peterro
2
how about
in bash:
for i in {1..5000}
do
echo $i
done
or something like
i=1
while [ $i -le 5000 ]
do
echo $i
i=$((i+1))
done
for ((i=1;i<=5000;i++)); do
cp -p a.txt urnewdir/a${i}.txt
done
Phil_FL
4
n=1
while [ $n -le 5000 ]
do
cp a.txt ../a$n.txt
n=$(( n+1 ))
done
../a$n.txt will copy on the parent directory where the script is executed, put whatever you want as a full path for instance.