On a Linux server I have a directory full of files with digits for names. Some of the files start with two zeros such as 00305005. I am writing a bash shell script and one of the steps is to rename all of the files that start with 00 so they start with @0. The file I mentioned earlier would be @0305005.
The issue I am having is that when I try to rename the files I end up changing all instances of 00 in the file name to @0 like this: @0305@05. I have been using the following code and I don't know how to fix it:
for f in 00*; do mv "$f" "${f//00/@0}"; done