Last active
July 9, 2019 13:19
-
-
Save TB-O-gh/8531cb0991a643e1d029c031f1e26756 to your computer and use it in GitHub Desktop.
ファイルの連番リネームスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# ディレクトリのファイルを連番ファイルとしてリネームする。 | |
set -e | |
suffix='jpg' | |
if [ $# = 0 ] | |
start_number=0 | |
else | |
start_number=$1 | |
if | |
for for_list in `ls *.$suffix`; | |
do | |
mv ${for_list} $( printf %07d ${start_number} ).$suffix | |
j=$(( $start_number + 1 )) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment