Shell Script for addition ann run against multiple files
Posted on 2006-06-20
I have the following Shell Script where it replacing old string/lines with new lines in a
file (actually it is a makefile)
The script works halfway though, , since when it encounters space or tab it does not replace old strings/lines
My question is using this K-Shell Script
1. how to take care space or tab fro the replacement ?
2. I want to add a new line (LINK = cc -G -mt -o) in all files ?
3. I am running the script against one file
sed -f test.sed input.txt > output.txt
Instead how can I run the script against all 100 files ( they are all same type makefile) ?
Following is the script I am using
#The script substitute old lines with new lines in *.mak file
s/-D_HPUX_SOURCE -DFND_HPUX/-D__sun -DFND_SUN/
s/-Dfnd_hp -c -Aa $(DEBUG) +O2 +DS897/-Dfnd_sun \$(DEBUG) -c -Xa -O -xcg92 -xcode=pic32/
s/LINKFLAGS = -Wl,-B,immediate,+s,-q/#LINKFLAGS = -Wl,-B,immediate,+s,-q/
LINK = cc -G -mt -o/
#sed -f test.sed input.txt > output.txt