I have a script which will build some source code by filtering it first
through a set of
preprocessors first.
for example: if I had a CSH script:
#! /bin/csh -f
foreach file ($argv[1-])
if(-e $file) then
cat $file |first_pp|second_pp|third_pp|fourth_pp >$file.dat
if($status) then
echo compilation failed
exit 1
endif
endif
end
The problem is that the $status only reflects the exit status of
"fourth_pp".
I need to exit with errors if "first_pp", or "second_pp", or "third_pp" also
exited abnormally.
I could do each process separately and make intermediate files, but the file
sizes are too large in-between, and that seems like a kludge. Is there an
elegant way ?
My only other way is to have each preprocessor create an error file, and
detect its existence at the end. That also seems like a kludge.
Is there a way to do this? another Shell type that support this.
#! /bin/csh -ef does not do this either.
HELP!
please email: