Created
March 4, 2012 02:47
-
-
Save nodokodo/1970179 to your computer and use it in GitHub Desktop.
Move <script> tags to bottom of <body> using sed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# warning: only tested on single line script tags, no doubt broken on multi-line | |
# useful for includes! | |
[ $# -eq 0 ] && { echo "Usage: ${0} file-name" ; exit 1; } | |
$FILE=$1 | |
sed -in '/script/{h;d};/\/body/{H;g}' $FILE | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment