I have a simple bash for loop and am trying to execute a command inside of it. The loop is so I can execute different file names.
the files are:
crystal0_cmin.pdb
crystal1_cmin.pdb
.
.
.
the loop is:
for ((i=0;i<=10;i++))
do
cp Files/crystal$i_cmin.pdb Energy/
cp Files/crystal$i_cmin.psf Energy/
done
The problem is that I always get the following error message:
cp: cannot stat `Files/crystal.pdb': No such file or directory
cp: cannot stat `Files/crystal.psf': No such file or directory
but I never specify the files crystal.pdb and crystal.psf. It just ignores the $i extension for all i. That is, none of the files get copied.
Does anyone know how I can fix this.
Thanks!
cp Files/crystal{0..10}_cmin.p{db,sf} Energy