Last active
March 2, 2017 11:53
-
-
Save glynhudson/2fba72e5eb894ac2d4918b3ed2bcb957 to your computer and use it in GitHub Desktop.
Remove x number of lines from the bottom of all html files in a directory (default 1 line removed)
This file contains hidden or 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
for file in ./*.html; do | |
[ -f "$file" ] && | |
length=$(tail -n 1 "$file" | wc -c) && | |
[ "$length" -gt 0 ] && | |
truncate -s "-$length" "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment