I have a set of commands to change the contents of files called MenuSettings which work fine when directed to a folder.
cd /Applications/snowflake/table-updater/Testing/Applications/Salford_100
sed -e '1r MenuSettings.bak' -e '1,2d' MenuSettings.txt >> MenuSettings2.txt
cat MenuSettings2.txt | sed '/^AppName: */{h;s///;x;}; /^\(AppName_.._..:\).*/{s//\1/;G;s/\n/ /;}' >> MenuSettings3.txt
rm -v MenuSettings2.txt
mv -v MenuSettings3.txt MenuSettings.txt
However when I try to run them through multiple folders writing this
for dir in $(find salford_* -type d);do
sed -e '1r MenuSettings.bak' -e '1,2d' MenuSettings.txt >> MenuSettings2.txt
cat MenuSettings2.txt | sed '/^AppName: */{h;s///;x;}; /^\(AppName_.._..:\).*/{s//\1/;G;s/\n/ /;}' >> MenuSettings3.txt
rm -v MenuSettings2.txt
mv -v MenuSettings3.txt MenuSettings.txt
done
I get the error
sed: MenuSettings.txt: No such file or directory
Which renders all the following commands ineffective, and I end up with a blank text file on the root of my search. MenuSettings.txt is in every directory with the Salford name. And when i test find to echo what its searching for it shows everything fine. Ive tried a number of find methods but to no avail, can anyone help