Skip to content

Instantly share code, notes, and snippets.

@adamvduke
Created December 21, 2010 04:34
Show Gist options
  • Save adamvduke/749493 to your computer and use it in GitHub Desktop.
Save adamvduke/749493 to your computer and use it in GitHub Desktop.
Inline edits text files to add a newline between the start of a control block i.e. method declaration, if/else statement etc... and opening curly brace.
#gsed is the GNU version of sed
#OSX ships with the BSD version which is apparently not the same
gsed -i 's/\([[:space:]]*\)\([[:print:]]\{1,\}\){/\1\2\n\1{/' ./Classes/*.m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment