Re: [ssfr] utilisation de bc |
[ Thread Index |
Date Index
| More debianworld.org/shellscript-fr Archives
]
- To: shellscript-fr@xxxxxxxxxxxxxxx
- Subject: Re: [ssfr] utilisation de bc
- From: JJL <buggerone@xxxxxxxxx>
- Date: Tue, 15 Jul 2008 11:32:52 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=BjeRghmgZgtqjRBS8DmilMhCQT3asFiCKBceKvSYOmU=; b=fGZEH2xC6dPJ5mfHw03MW1vS8jmMmNxebSo76rl6HeYVBhn8n0tCGZbW2uSwwmxUJ1 HLMx5sZjHgE6nohwcS1hFznPy5WCXgP4Uo7d6KsloYoIaV3u+Up9NRwxizaymfcoZbow +e9SdodEYH6q3/O6XDf0QcQQqEqTn2di8Hqdo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=a5PPjD8jtHn2XUnUQprWqba2zsNlg0yNF78E7V8PSQ+pFudXWrLdQ/no+YZX8pNBo5 sZ48KFxPAgnc5fxPSdL+k+e4i0WyVK2TBHHEwYRQwYFb0kRg9zlhbOS0cU2MlitbTBTT Dvrg8jsLkaU2m6xKQHaMj/rrHv7ceTpXUzAG0=
Salut,
> ./pi.sh: line 20: [: 1.131370: integer expression expected
bc peut faire des comparaisons sur des floats
un exemple de syntaxe :
echo 'scale=6; if (1.5 < 1.2) "inf" else "sup"' | bc
qui affichera inf si 1.5 est inférieur à 1.2, sup sinon.
JJL
--
http://kubuntu.free.fr/blog
---