0

I need to execute a short script that just renames a few files (mv).

The script is in about 50 folders, each folder is named and currently I'm executing them from the shell and moving to the next folder using:

bash rename && cd ../folder01

Then pressing up and changing the last digit(s).

Is there a way to execute the script in all folders in one line?

4

1 回答 1

4

当然,使用 for 循环:

for f in folder*; do (cd "$f" && bash rename) ; done
于 2013-07-05T11:19:13.823 回答