deshantm at gmail.com
Mon Jun 27 14:59:42 UTC 2005
On 6/26/05, James Gray <james at grayonline.id.au> wrote:
> On Mon, 27 Jun 2005 07:13 am, Todd Deshane wrote:
> > When you want to compare strings use ==
> > If you want to compare numbers you the -eq (equal)
> > -lt (less than) -le (less than or equal to) .... etc.
> > so one of your conditions was something like:
> > $num_tries != $max
> > instead it could be
> > $num_tries -lt $max
> The translation of "!=" is "not equal" which in bash scripting (comparing
> numbers) is "-ne", as opposed to "-lt" (less than) as stated above.
> Although I agree that "-lt" is probably better logic than "-ne" in the
> case of
> the OP's script. :)
Glad you were pedant on this one, I am not a bash expert
but can usually figure out or look up what I need, wasn't
sure what not equals was, but knew that less than equals
was better logic.
> In Brooklyn, we had such great pennant races, it made the World Series
> just something that came later.
> -- Walter O'Malley, Dodgers owner
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ubuntu-users