Skip to content

Instantly share code, notes, and snippets.

@zyan0
Created January 1, 2014 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zyan0/8208458 to your computer and use it in GitHub Desktop.
Save zyan0/8208458 to your computer and use it in GitHub Desktop.
#!/bin/bash
SCRIPT=substitute.sh
for f in *
do
if [ $f = $SCRIPT ]
then
echo "skip $f"
continue
fi
echo -n "substitute ext2 to myext2 in $f..."
cat $f | sed 's/ext2/myext2/g' > ${f}_tmp
mv ${f}_tmp $f
echo "done"
echo -n "substitute EXT2 to MYEXT2 in $f..."
cat $f | sed 's/EXT2/MYEXT2/g' > ${f}_tmp
mv ${f}_tmp $f
echo "done"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment