Unix Shell Script Migration to UCP - expr syntax error
startLine=`grep -n 'SELECT ' $TempSQLOutput | awk -F":" '{ print $1}'`
startLine=`expr $startLine + 4` endLine=`grep -n 'record(s) selected' $TempSQLOutput | awk -F":" '{ print $1}'` endLine=`expr $endLine - 2` This was the code and i am getting expr: syntax error in test autosys.Please suggest a solution? |
The last basically equals to expr - 2 as endLine is empty.
|
if it was bash you can use:
Code:
endLine=`expr ${endLine:-0} - 2` |
I would also add that awk could get you the count and add 4 to it without the need for expr or grep
|
All times are GMT -5. The time now is 08:00 PM. |