Skip to content

Instantly share code, notes, and snippets.

@naganowl
Created September 12, 2018 01:05
Show Gist options
  • Save naganowl/02a0c52d878c31c46baa812e861e4ad5 to your computer and use it in GitHub Desktop.
Save naganowl/02a0c52d878c31c46baa812e861e4ad5 to your computer and use it in GitHub Desktop.
Replace blank lines with just a single one
# Inspired by https://unix.stackexchange.com/questions/72739/how-to-remove-multiple-blank-lines-from-a-file
for i in `grep -rl classSelector app/assets/stylesheets/` ; do cat $i | awk '!NF {if (++n <= 1) print; next}; {n=0;print}' | tee $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment