Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bad math expression due to parameters
- X-seq: zsh-users 9376
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: Bad math expression due to parameters
- Date: Sat, 03 Sep 2005 03:53:08 +0000
- In-reply-to: <20050902231650.GB289@DervishD>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050902231650.GB289@DervishD>
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