Guest User

Untitled

a guest
Jul 16th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. head.body.date.txt
  2.  
  3. head_body_date.txt
  4.  
  5. for f in *.*.*.txt; do i="${f%.txt}"; echo mv -i -- "$f" "${i//./_}.txt"; done
  6.  
  7. for f in *.*.*.txt; do i="${f%.txt}"; mv -i -- "$f" "${i//./_}.txt"; done
  8.  
  9. for f in *.*.*.*; do pre="${f%.*}"; suf="${f##*.}";
  10. echo mv -i -- "$f" "${pre//./_}.${suf}"; done
  11.  
  12. for f in *.*.*.*; do pre="${f%.*}"; suf="${f##*.}";
  13. mv -i -- "$f" "${pre//./_}.${suf}"; done
  14.  
  15. for f in *.*; do pre="${f%.*}"; suf="${f##*.}";
  16. mv -i -- "$f" "${pre//./_}.${suf}"; done
  17.  
  18. $ rename -n 's/.[^.]+$(*SKIP)(*F)|./_/g' head.body.date.txt
  19. rename(head.body.date.txt, head_body_date.txt)
  20.  
  21. $ rename -n 's/.(?![^.]+$)/_/g' head.body.date.txt
  22. rename(head.body.date.txt, head_body_date.txt)
  23.  
  24. rename 's/.(?=[^.]*.)/_/g' *.txt
  25.  
  26. old=head.body.date.txt oldb=${old%.*} olde=${old##*.} ;
  27. mv -- "$old" "${oldb//./_}.${olde}"
  28.  
  29. mv "head.body.date.txt" "$(echo head.body.date.txt | rev | sed 's/./_/2g' | rev)"
  30.  
  31. for file in *.txt; do mv "$file" "$(echo $file | rev | sed 's/./_/2g' | rev)"; done
  32.  
  33. mv head.body.date.txt head_body_date.txt
Add Comment
Please, Sign In to add comment