Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bad math expression due to parameters



On Sep 3,  1:16am, DervishD wrote:
}
}     [[ $OPTARG -lt 8 ]] && OPTARG=8
} 
}     [when] $OPTARG is "--" and that gives a "bad math expression" in
} the test above.
} 
}     How can I solve this? Must I validate $OPTARG before messing with
} it on a math expression?

Either that, or cheat by not using math at all.

    [[ $OPTARG = <-7> ]] && OPTARG=8

However, I would think you want to treat "--" as a special case before
you get as far as doing other stuff with OPTARG.



Messages sorted by: Reverse Date, Date, Thread, Author