vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi , have a problem in a Kornshell script that I have so far been unable to get around. The section applies to a test on an integer variable. Code reads: typeset -i file_count if [ $file_count -eq 0 ] then return else process_file fi The problem seems to arise when the variable is set to a value that is a multiple of 256. The function containing this section has returned (unexpectedly) when the value of file_count has been set to a value of 256, 512 and 1024. Any suggestions welcome, as this is drivin' me nuts...... Thanks. |
| |||
| snickwad wrote: > Hi , have a problem in a Kornshell script that I have so far been > unable to get around. > > The section applies to a test on an integer variable. > Code reads: > > typeset -i file_count > > if [ $file_count -eq 0 ] > then > return > else > process_file > fi > > The problem seems to arise when the variable is set to a value that is > a multiple of 256. The function containing this section has returned > (unexpectedly) when the value of file_count has been set to a value of > 256, 512 and 1024. > At least on AIX 5.1 and ksh (88) i could not reproduce the problem. Your script example works as expected. Hajo |
| ||||
| snickwad <ashley.dawkins@blueyonder.co.uk> wrote: > Hi , have a problem in a Kornshell script that I have so far been > unable to get around. > > The section applies to a test on an integer variable. > Code reads: > > typeset -i file_count > > if [ $file_count -eq 0 ] > then > return > else > process_file > fi > > The problem seems to arise when the variable is set to a value that is > a multiple of 256. The function containing this section has returned > (unexpectedly) when the value of file_count has been set to a value of > 256, 512 and 1024. > > Any suggestions welcome, as this is drivin' me nuts...... Try 'set -x' in the script and see what really happens. Yours, Laurenz Albe |