Skip to content

Instantly share code, notes, and snippets.

@mhenrixon
Created April 22, 2014 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhenrixon/11172234 to your computer and use it in GitHub Desktop.
Save mhenrixon/11172234 to your computer and use it in GitHub Desktop.
Recursively adds newline to the end of every file with the .rb extension
for file in **/*.rb; do
[ -e "$file" ] || continue
if [[ -n "$(tail -c 1 <"$file")" ]]; then
echo >> "$file"
fi;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment