I'm trying to write a script to find all the report titles in our program directories. The key I can use for this is "w-title". My biggest problem is that the actual title may be on the next line so I need to print out both lines.
I'm brand new to scripting so there's probably something obvious in what I'm trying to do and not succeeding in. This is the first time I've ever tried to use sed or awk and my scripting is almost as limited.
I'm running on AIX 5.3.
find . -name "*.p" -type f > /home/gls/tmp-file
chmod 666 /home/gls/tmp-file
for x in `cat /home/gls/tmp-file`
do
awk '/w-title/{printf $0:next}1'$x >> /home/gls/list-titles.txt
done
chmod 666 /home/gls/list-titles.txt
I get the error "` is not expected.itles.[29]: 0403-057 Syntax error at line 32 : `do"
I've Googled, searched thru Tek-Tips, read my massive Unix book and I'm still clueless. Can anyone give me a hint of what I'm doing wrong?
Any help is greatly appreciated.
I'm brand new to scripting so there's probably something obvious in what I'm trying to do and not succeeding in. This is the first time I've ever tried to use sed or awk and my scripting is almost as limited.
I'm running on AIX 5.3.
find . -name "*.p" -type f > /home/gls/tmp-file
chmod 666 /home/gls/tmp-file
for x in `cat /home/gls/tmp-file`
do
awk '/w-title/{printf $0:next}1'$x >> /home/gls/list-titles.txt
done
chmod 666 /home/gls/list-titles.txt
I get the error "` is not expected.itles.[29]: 0403-057 Syntax error at line 32 : `do"
I've Googled, searched thru Tek-Tips, read my massive Unix book and I'm still clueless. Can anyone give me a hint of what I'm doing wrong?
Any help is greatly appreciated.