Skip to content

Instantly share code, notes, and snippets.

@niallsmart
Created September 18, 2011 18:37
Show Gist options
  • Save niallsmart/1225376 to your computer and use it in GitHub Desktop.
Save niallsmart/1225376 to your computer and use it in GitHub Desktop.
Sed script to add "use strict"; to the top of JavaScript files
#
# Sed script to add "use strict"; to the top of files that don't
# already have it there.
#
# use like this: find . -name \*.js | xargs -n 1 sed -f make-strict.sed -i ''
#
1 { s/use strict/&/
t
i\
"use strict";
x
G
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment