I am new to scripting, and I have a directory with all files named num.pdb.ostat. I would like to rename all num.ostat (that is deleting the .pdb in all). For a single file this works:
mv 2.pdb.ostat 2.ostat
but when I try to do it for all files in folder with this script
for num in ./*; do mv ${num}.pdb.ostat ${num}.ostat; done
nothing happens
Can anyone tell me, where I went wrong?
rename.ul
utility? It will be something like this:rename.ul pdb. . *ostat
and it should rename the files.rename 's/pdb.//' *.pdb.ostat
Can anyone tell me, where I went wrong?
, so it's not a dupe exactly, although the link is certainly helpful.