>Can anyone tell me why this is happening?
>
>[tom@littlefear tom]$ date +%j -d 04/01/2002
>091
>[tom@littlefear tom]$ let due=`date +%j -d 04/01/2002` ; echo $due
>bash: let: due=091: value too great for base (error token is "091")
>100
>
>[tom@littlefear tom]$ date +%j -d 01/31/2002             
>031
>[tom@littlefear tom]$ let due=`date +%j -d 01/31/2002` ; echo $due
>25


The leading 0 apparently induces bash's arithmetic
evaluator (forced into action by your invocation of
"let") to interpret the digit string as octal, thus
making the 9 an invalid digit.

These variations work:

    due=`date +%j -d 04/01/2002`                   ; echo $due
let due=`date +%j -d 04/01/2002 | sed -e 's/^0//'` ; echo $due



*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to