Skip to content

Instantly share code, notes, and snippets.

@TB-O-gh
Last active July 9, 2019 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TB-O-gh/8531cb0991a643e1d029c031f1e26756 to your computer and use it in GitHub Desktop.
Save TB-O-gh/8531cb0991a643e1d029c031f1e26756 to your computer and use it in GitHub Desktop.
ファイルの連番リネームスクリプト
#!/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