Skip to content

Instantly share code, notes, and snippets.

@annikoff
Created December 1, 2016 18:33
Show Gist options
  • Save annikoff/e548460558d3ced912cfd9b87ebd41d5 to your computer and use it in GitHub Desktop.
Save annikoff/e548460558d3ced912cfd9b87ebd41d5 to your computer and use it in GitHub Desktop.
This adds \n at the end of the file only if it doesn’t already end with a newline.
for f in **/*.@(rb) ;do
sed -i -e '$a\' $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment