Quote:
Originally Posted by philplasma
without the back ticks it didn't work, so thanks go to the Smiling Dragon for helping out and thanks joeyg for the attempt. However, it still doesn't work, I get the following as a result:
Code:
" near 0wn operator in arithmetic expression "0
There is no quotation mark present in the sqlplus.out file, though I decided to vi the file and found that there is a ^M character at the end of each line. I should let you know that this is a unix emulator on a windows server. Another thing to mention is that the result in the sqlplus.out file does not start at the first character, sqlplus right justifies the value with the field header - for whatever reason the unix.com forum interface put it to the left. Thanks again for the assistance!
|
Ah, in that case, we can make the search for 0 on the last line a little more robust, the following will trigger if you get a non-zero exit code but will ignore any non-digit characters on the line. You could add a second grep for a 0 afterwards to confirm it's given an exit code at all but I've left that off in the example below:
Code:
if `tail -1 sqlplus.out | egrep '[1-9]'` ; then ...