Hello friendly computer people
This is a two-part question. I am writing two shell scripts with the goal of "finding and replacing" in all index.php files in a folder and its subfolders.
The first shell of the script is this:
echo "running on all directories…"
find . -name '*.php' -exec ./search_replace.sh {} \;
which then runs the search_replace file:
echo "running search and replace script..."
sed -e 's/http:\/\/ericbrotto.com/file:\/\/\/Users\/ericbrotto\/Documents\/Portfolio_CV_etc.\/Offline_Portfolio/g' index.php > index.htm
My problems / questions are as follows:
When I run the first script, echos "starts the search and replaces the script ..." 13 times, which makes sense because there are 13 index.php files in the folders. But the result is that only one file is complete, that is, the words are replaced, and a new htm file is created only once.
, .htm .php, index.php ? , .
,