Skip to content

Instantly share code, notes, and snippets.

@naholyr
naholyr / 1-line.sh
Last active Aug 17, 2017
Add "use strict" everywhere
View 1-line.sh
find -name '*.js'|grep -v '^./node_modules'|while read f;do if (head -n3 "$f"|grep -Fv 'use strict'>/dev/null);then echo "$f";sed -i -e '1i "use strict"\n' "$f";fi;done