Archive

Archive for the ‘Delete the JavaScript’ Category

To delete the JavaScript Tag in HTML Files

August 4, 2010 Leave a comment

sed -i  ‘/<script type=”text\/javascript”/,/<\/script>/d’  *.html

OR

U can use following code also for same process

#!/bin/bash
# ALL HTML FILES
FILES=”*.html”
# for loop read each file
for f in $FILES
do
INF=”$f”
OUTF=”$f.out.tmp”
# replace javascript
sed ‘/<script type=”text\/javascript”/,/<\/script>/d’ $INF > $OUTF
/bin/cp $OUTF $INF
/bin/rm -f $OUTF
done

%d bloggers like this: