Advertisement
deckoff

renF

Aug 28th, 2012
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # add .full to the end of any file, right before the file extension. This is useful for renaming a folder full a MTG pictures, so they are prepared for Magic Workstation.
  4.  
  5.  
  6.  
  7.  
  8. SFILES="*.jpg"
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. for f in ${SFILES}
  16. do
  17.   mSuffix=$(echo $f | awk 'BEGIN { FS = "." } ; {print $1}')
  18.  
  19.  
  20.  
  21. mNewFName="$mSuffix"".full.""jpg"
  22.  
  23. echo $mNewFName
  24.  
  25. #empty space before the ext of the file is cleared
  26. #mNewFName=$(echo ${mNewFName} | sed 's/ .bg.'$mSuffix'/'.bg.$mSuffix'/g')
  27.  
  28.  
  29. mv "${f}" "${mNewFName}"
  30.  
  31.  
  32. #ShowNumber=$((ShowNumber+1))
  33.  
  34. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement