K
ku916
I wrote a perl script that would read stdout and parse for particular
set of keywords, if found it will exit with error status.
sample cmd:
perl_filter.pl is my script
since we passed in <wrong_password> into sqlplus, perl_filter.pl will
parse the stdout (from sqlplus) and find the keyword (i.e. error) and
exit with non-zero value
but the problem I'm having now is that when the parent command itself
errors out how can perl_filter.pl catch the exit value ($?) viva pipe
like:
since there is no program called sqlpus, it will return non-zero exit
value, but perl_filter.pl would not detect any stdout keyword and it
will just exit and return success (zero) value.
any suggestions would be great help
Thanks
set of keywords, if found it will exit with error status.
sample cmd:
sqlplus user/wrong_password @somesql.sql | perl_filter.pl
perl_filter.pl is my script
since we passed in <wrong_password> into sqlplus, perl_filter.pl will
parse the stdout (from sqlplus) and find the keyword (i.e. error) and
exit with non-zero value
but the problem I'm having now is that when the parent command itself
errors out how can perl_filter.pl catch the exit value ($?) viva pipe
like:
sqlpus user/wrong_password @somesql.sql | perl_filter.pl
since there is no program called sqlpus, it will return non-zero exit
value, but perl_filter.pl would not detect any stdout keyword and it
will just exit and return success (zero) value.
any suggestions would be great help
Thanks