Is it possible to search in a file using shell and then replace a value? When I install a service I would like to be able to search out a variable in a config file and then repl
filepath="/var/start/system/dir1" searchstring="test" replacestring="test01" i=0; for file in $(grep -l -R $searchstring $filepath) do cp $file $file.bak sed -e "s/$searchstring/$replacestring/ig" $file > tempfile.tmp mv tempfile.tmp $file let i++; echo "Modified: " $file done