Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Bash rename PDFs
- # Working fiddle: https://regex101.com/r/rQ9lX1/1
- # Note: $(< "$f" wc -l) is the suffix with a word count [fairly random!]
- # Note: Remove '-n' is the result is as expected
- for f in *.pdf; do rename -n "s/([^.]+)(\.?.*)/\$1_$(< "$f" wc -l)\$2/" "$f"; done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement