let probleme


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers let probleme
# 8  
Old 06-16-2004
[ $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
# 9  
Old 06-16-2004
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"
# 10  
Old 06-16-2004
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  
Old 06-17-2004
OK! It's a good idea!

Thanks a lot Perderabo and pressy Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Linux

Problème d'interface réseau

bonjour, j'ai un serveur Linux ayant 2 interfaces eth0 et eth1. j'ai configuré deux adresses IP de deux réseaux différents sur les 2 interfaces, et je les ai connecté sur 2 commutateurs différents. l'adresse IP de eth0 répond sans problème au ping des équipement de son réseau d'appartenance, malheureusement cela... (1 Reply)
Discussion started by: cerco
1 Replies

2. AIX

Probléme pour agrandir LV et FS

Bonjour, Je travail sur un environnement AIX 5.3 et je n'arrive pas à augmenter mon FS ni mon LV. J'utilise les commande suivante chfs -a size=+4G /home/guesting ou extendlv sybase5lv 4 et rien à faire il me retourne que le maximum capacity est atteint au niveau du LV alors qu'il y a des PP de... (6 Replies)
Discussion started by: mosta
6 Replies

3. Solaris

Probleme avec SVM

Bonjour, J'ai ajouté par erreur à un sous mirroir des disques de cette facon : metattach d53 c2t90d0s0 c2t90d1s0 ... alors que j'aurais du faire un stripe par disque (comme ça) : metattach d53 c2t90d0s0 metattach d53 c2t90d1s0 .. Derriere, j'ai fais un growfs -M du FS pour l'aggrandir et... (1 Reply)
Discussion started by: phil.nakache
1 Replies

4. Filesystems, Disks and Memory

probléme de montage de clé usb

hi i'm trying to mount my usb device in fedora 7(vmware) i use the comand: mount /sda1 /mnt but when i go to /mnt i find the content of the folder /boot. can u tell me what's the problem? (2 Replies)
Discussion started by: jalil smail
2 Replies

5. UNIX for Advanced & Expert Users

[ Environment Variable ] Probleme with export JAVA_HOME

Hi, I want to create a new environment variable (JAVA_HOME), but when I open a new shell this varible is delete... to create the variable I do : export JAVA_HOME=/usr/java/jdk and I verify with : echo $JAVA_HOME and it's work... But When I open a new shell this variable is forget... ( It... (2 Replies)
Discussion started by: marcel_kobain
2 Replies

6. IP Networking

Route add probleme

I have a system that i want to reach via a vpn created vi a fierwall.The fierwall in an other system. The ip i am trying to get to is 172.16.4.48 I need to get to it via the hme1 interface. The vpn gateway has this ip 172.30.50.1 I need to clean up the routing table and make this work; or is it... (5 Replies)
Discussion started by: waterboy
5 Replies

7. AIX

Probleme with DVD Writer

I can write into DVD? I have USE "MKCD" command mkcd -r directorie -d /dev/cd1 please help me it s urgent (2 Replies)
Discussion started by: mktahar
2 Replies

8. UNIX for Advanced & Expert Users

Probleme With DVD Writer

I Use mkcd for save same directories into DVD, But the commande not complete succefuly mkcd -r directorie_i_whish_save -d /dev/cd1 please it is very urgent thank you :confused: :confused: (1 Reply)
Discussion started by: mktahar
1 Replies
Login or Register to Ask a Question