The "y" command to sed does "transliteration" according to the sed manual page ("man sed"). If you want to replace all instances of strtolower with lower, then use "s" like this:
Here's a little script I once wrote to replace all instances of string1 with string2 in all files matching filespec. I used it just yesterday to change all instances of POST to GET in a bunch of PHP files. You might find it helpful:
The "ls $3" command to get the filelist may not work correctly if you have files with embedded spaces. I never create such files so I don't encounter the problem. Also if the strings have underscore characters in them, you'll need to use a different delimiter in sed. The forward slash is the usual choice, as I used in the initial response above; the percent sign is often a good alternative.
if [ "$1" = "" ]
echo "Syntax: replaceall 'string1' 'string2' 'filespec'"
echo "Include the single quotes in your command"
mkdir -p $TMP/$NOW
for i in $FILES;
TEST=$(grep "$1" $i)
#echo "Checking $i; TEST=$TEST" #uncomment for debugging
if [ "$TEST" != "" ]
echo "Replacing '$1' with '$2' in $i"
# save backup copies
cp $i $TMP/$NOW/$i.bak
# do the replacement
(sed "s_$1_$2_g" $i > $i.new) && (rm -f $i; mv $i.new $i)
You'll find the backup copies in ~/.replaceall/[some number]; the largest number is the most recent save.