let probleme


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers let probleme
# 1  
Old 06-16-2004
let probleme

Hi!

I have a script shell and I must do a calculation:

let c=7/4

echo $c => 1 Smilie

and me I want 1,75

Is it possible to find 1,75 in shell?


Thinks!
# 2  
Old 06-16-2004
..........

hiho,

c=$(printf "%s\n" 'scale = 2; 7/4' | bc)

this works fine for me.. hope for you too


greetings pressy
# 3  
Old 06-16-2004
It's Ok


think you!
# 4  
Old 06-16-2004
I come back with an other question

a=1
c=$(printf "%s\n" 'scale = 2; 7/4' | bc)


when i do:

if [ $a -eq $c ]

it find the same number [ 1 -eq 1 ]

And I want compare [ 1 -eq 1.75 ] or [ 1 -eq 1,75 ]
Is it possible?
thanks
# 5  
Old 06-16-2004
........

i tested you condition... on solaris/ksh it works...

you could also try
if [ $a == $c ]; then

g P
# 6  
Old 06-16-2004
Thinks but I am on AIX... It don't work....
# 7  
Old 06-16-2004
Error .........

if [ $a == $c ]; then
thats ksh syntax.... which shell are you using
 
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