shell - Ksh arithmetic anomaly -


i have following lines in script:

nr_of_requests_in_progress=$(db2 -x "select count(*) my_table date='$my_date' , status = 'expected_status' , id in ($current_id, $other_id)" | awk '{print $1}') while [[ $nr_of_requests_in_progress -gt 0 ]];   [...] done 

now works in env, yet when colleague of mine tests it, gets arithmetic syntax error line. how come?

what colleague's screen show if add set -vx before assignment nr_of_req..s. ?

the problem call db2 not returning numeric value.

just remember, set -vx friend (even if rather unwieldy when dealing large and/or nested while/for/if-then-else-fi blocks of code :-) )

ihth


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -