![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| probléme de montage de clé usb | jalil smail | Filesystems, Disks and Memory | 2 | 04-19-2008 04:45 AM |
| [ Environment Variable ] Probleme with export JAVA_HOME | marcel_kobain | UNIX for Advanced & Expert Users | 2 | 12-06-2007 06:12 AM |
| Route add probleme | waterboy | IP Networking | 5 | 08-17-2007 08:20 AM |
| Probleme with DVD Writer | mktahar | AIX | 2 | 12-04-2005 01:46 AM |
| Probleme With DVD Writer | mktahar | UNIX for Advanced & Expert Users | 1 | 11-26-2005 08:42 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
||||
|
||||
|
[ $a == $b ] does seem to work on solaris but it's not general. It fails on hp-ux too. Use
[ $a = $b ] But be aware that this is a string compare. a=1 b=1.0 [ $a = $b ] will be false |
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
I reformulate my question because that I say is not clear.
a=1 b=1.75 or 1,75 if [ $a -lt $b ] then echo " It is normal 1 < 1,75" else echo "ANOMAL" fi And I want this message: "It is normal 1,75 > 1"
__________________
AIX 5.2 C@stelior |
|
#10
|
||||
|
||||
|
Castelior, the ksh supplied with AIX does not have support for any non-integer arithmetic. It can't add or subtract or even compare them. So you will have to do everything using other programs. If a is less than b, then the expression a-b will be negative. Negative numbers will have a minus sign as the first character.
a=1 b=1.75 c=$(echo $a - $b | bc) if [[ $c = -* ]] ; then |
|
#11
|
|||
|
|||
|
OK! It's a good idea!
Thanks a lot Perderabo and pressy
__________________
AIX 5.2 C@stelior |
|||
| Google The UNIX and Linux Forums |