Advertisement
Twilypastes

4cdl-rename-tool

Jun 6th, 2015
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.58 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Intended for renaming selected '4cdl' images for reuploading to 4chan.
  4. # Do Not run these over each other or more than once on the same filenames.
  5. # Place the selected '4cdl' images in an empty directory along with this file.
  6. # Uncomment One of the lines below to use $ sh ./rename
  7.  
  8. # Removes last upload id; keeping <Original Filename>.ext (Only run once)
  9. #f=(*); for i in "${f[@]}"; do mv -i "$i" "${i#*-}"; done
  10.  
  11. # Removes original filename; keeping <Last Upload ID>.ext (Only run once)
  12. #f=(*); for i in "${f[@]}"; do mv -i "$i" "${i%%-*}.${i#*.}"; done
  13.  
  14. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement