This is a beginner question: I'm trying to write a .sh file to automatically rename files in a directory.
The file would look something like
for fileName in directory
do
mv fileName "NewPrefix"+fileName
done
I'm trying to figure out how to write the
for fileName in directory
part.
I tried the following:
dir = '.'
for fileName in dir
This is working, but whenever I run this script, I get dir: cannot access =: No such file or directory.
Why?