Replace String in Multiple Files using Unix Command
Shell Script allows you to replace string in multiple files using unix / linux command.
Features
Can replace string in multiple files using unix / linux command.
This shell script works in Linux operating system only.
It reduces time to replace string in multiple files
Easily customizable and configurable.
Downloads
#------------------Script by hscripts.com------------------# #--------------More scripts @www.hscripts.com---------------# OLDSTRING="string to be replaced" NEWSTRING="String to be replaced with" FOLDERPATH="/opt/lampp/htdocs/test/shell/*.php" NEWFOLDERPATH="/opt/lampp/htdocs/test/shell-test/" [ ! -d $NEWFOLDERPATH ] && mkdir -p $NEWFOLDERPATH || : for f in $FOLDERPATH doecho $ffname=`basename $f` sed "s#$OLDSTRING#$NEWSTRING#g" "$f" > "$NEWFOLDERPATH""$fname" echo $fname done # OLDSTRING - String to be replaced # # NEWSTRING - String to be replaced with OLDSTRING # # FOLDERPATH - Folder path with files # # NEWFOLDERPATH- Result folder with replaced strings in all files # #---------------- Script by hscripts.com-------------------------#