Created
November 18, 2013 05:12
-
-
Save mvasilkov/7522865 to your computer and use it in GitHub Desktop.
Remove empty lines at the end of file.
This file contains 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
#!/bin/bash | |
last_non_blank_ln=$(grep -En ^. $1 |tail -n 1 |sed 's/:.*//') | |
head -n $((last_non_blank_ln + 1)) $1 > _xxx | |
mv _xxx $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment