I have a directory that contains thousands of sub-directories. Structure like this:
I want to rename all the directories by adding 10000 to their current name. E.g.
I have written this script
for f in *; do if [[ -d $f ]]; then echo $f newd='expr $f + 10000' echo $newd mv $f newd fi done
from the 2
echos, I can see 1 and 10001.
mv actually move all my directories into a new folder called newd.
I tried $newd, doesn't work as well.
What could be done to make this thing works?