[ale] Bash question...

James P. Kinney III jkinney at localnetsolutions.com
Mon Jul 23 09:57:58 EDT 2007


On Mon, 2007-07-23 at 05:51 -0400, Brian J. Dowd wrote:
> Thanks for the suggestion, Ken.
> -B
> > You can use the arithmetic expression operator  - ((  )) 
> >
> > if (( $var < -4 )) ; then


Hmm. doesn't work for me...

[jkinney at merlin ~]$ bash -version
GNU bash, version 3.2.9(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
[jkinney at merlin ~]$ var=-4.3; if (( $var < -4 )); then echo "less"; else
echo "more"; fi
bash: ((: -4.3 < -4 : syntax error: invalid arithmetic operator (error
token is ".3 < -4 ")
more
[jkinney at merlin ~]$ 


Doesn't like the decimal place.

> > ..
> > fi
> > On Sun, 2007-07-22 at 10:37 -0400, Dr. Brian J. Dowd wrote:
> >> The value of $var is -4.865876
> >>
> >> if [ $var -lt "-4" ];
> >>
> >> throws an "Integer expression expected" error
> <snip>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
> 
-- 
James P. Kinney III          
CEO & Director of Engineering 
Local Net Solutions,LLC        
770-493-8244                    
http://www.localnetsolutions.com

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part




More information about the Ale mailing list