Regarding PID Shell Script

Posted by arav on Stack Overflow See other posts from Stack Overflow or by arav
Published on 2010-06-09T06:57:04Z Indexed on 2010/06/09 7:02 UTC
Read the original article Hit count: 203

I am calling another shell script testarg.sh within my main script. the logfiles of testarg.sh are stored in $CUSTLOGS in the below format

testarg.DDMONYY.PID.log example: testarg.09Jun10.21165.log

In the main script after the testarg process gets completed i need to grep the log file for the text "ERROR" and "COMPLETED SUCCESSFULLY". How do i get the PID of the process and combine with DDMONYY for grepping. Also i need to check whether file exists before grepping

$CUSTBIN/testarg.sh

$CUSTBIN/testarg.sh
rc=$?
if [ $rc -ne 0 ]; then
          return $CODE_WARN
fi

© Stack Overflow or respective owner

Related posts about linux

Related posts about unix