Operating System - HP-UX
1753945 Members
8332 Online
108811 Solutions
New Discussion

Re: Help with Unix Bourne Shell Script - Loop

 
SOLVED
Go to solution
A. Clay Stephenson
Acclaimed Contributor

Re: Help with Unix Bourne Shell Script - Loop

David, you was robbed. As long as I have been using UNIX I almost never turn to sed and yet it's so powerful,fast, and elegant. For some reason, about the only time I use it in is makefiles which call yacc. I use it to clean up the y.tab.c's and y.tab.h's. Your answer was much better!

Regards, Clay
If it ain't broke, I can fix that.
Mladen Despic
Honored Contributor

Re: Help with Unix Bourne Shell Script - Loop

Laurie,

Another way of doing it:

csplit '/^:::::/' '{*}'
for file in `ls xx*`
do
if grep 'job definition change' $file > /dev/null 2>&1
then
cat $file >>
fi
done
rm xx*



Mladen