Skip to content

Instantly share code, notes, and snippets.

@sipadan2003
Created January 14, 2020 07:11
Show Gist options
  • Save sipadan2003/fe913b5aac657be280d4eb3d796d5e8d to your computer and use it in GitHub Desktop.
Save sipadan2003/fe913b5aac657be280d4eb3d796d5e8d to your computer and use it in GitHub Desktop.
#!/bin/bash
num2=79
for num1 in `seq 40 60`; do
old_name=`printf "a_%03d" $num1`
new_name=`printf "a_%03d" $num2`
if [ -e ${old_name} ] && [ ! -e ${new_name} ]; then
mv ${old_name} ${new_name}
fi
num2=`expr ${num2} + 1`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment