I\'m trying to rename files e.g. screen-0001.tif
to 0001.tif
using the approach in this SO question:
for file in *.tif
do
echo mv \"$
Two things:
${file#screen-}
.${file/screen/}
The name of the environment variable always goes first. Then the pattern type, then the pattern
Here's how I would do this:
$ for file in *.tif
> do
> echo "mv '$file' '${file#screen-}'"
> done | tee mymove.sh # Build a shell script
$ vi mymove.sh # Examine the shell script and make sure everything is correct
$ bash mymove.sh # If all is good, execute the shell script.