#!/bin/bash
#
#USEAGE:
# change_str_infile.sh filepath filename old_str new_str;
#
# Get List of Files to Be Replaced
#file_list=`find path -name "*" -type f `
#file_list=`find $1 -name "*.c" -type f `
file_list=`find $1 -name "Make.rules" -type f `
for fn in $file_list
do
ffnt="$fn.temp"
echo "Processing $fn ...... "
sed "s/$2/$3/g" $fn > $ffnt
mv -f $ffnt $fn
done
#
#USEAGE:
# change_str_infile.sh filepath filename old_str new_str;
#
# Get List of Files to Be Replaced
#file_list=`find path -name "*" -type f `
#file_list=`find $1 -name "*.c" -type f `
file_list=`find $1 -name "Make.rules" -type f `
for fn in $file_list
do
ffnt="$fn.temp"
echo "Processing $fn ...... "
sed "s/$2/$3/g" $fn > $ffnt
mv -f $ffnt $fn
done