Created
October 18, 2012 10:23
-
-
Save sasasin/3910894 to your computer and use it in GitHub Desktop.
なんだかよくわからない、リネームコマンドです。
This file contains 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
#!/bin/sh | |
ls *.pdf \ | |
| grep -v '^zip2pdf\.' \ | |
| sort \ | |
| perl -wnl -aF'\.' -e 'print(pop(@F) . "|" . join(".", @F) . "|" . "19990104." . sprintf("%06d", $.) )' \ | |
| awk 'BEGIN{FS="|"}{print "mv \"" $2 "." $1 "\" zip2pdf." $3 "." $1}' \ | |
> hoge.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment