Skip to content

Instantly share code, notes, and snippets.

@nottrobin
Created October 16, 2017 15:02
Show Gist options
  • Select an option

  • Save nottrobin/c5c2ffb8cbf0a1a88d77acaeb574fe64 to your computer and use it in GitHub Desktop.

Select an option

Save nottrobin/c5c2ffb8cbf0a1a88d77acaeb574fe64 to your computer and use it in GitHub Desktop.
Remove multiple blank lines next to each other from a file
#!/bin/sh
grep -v -A1 '^[[:blank:]]*$' $1 | grep -v "^--$" > $1.tmp
mv $1.tmp $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment