Deutsch   English   Français   Italiano  
<87fssx56rx.fsf@universite-de-strasbourg.fr.invalid>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!news.uzoreto.com!aioe.org!nwhFLAbnWMrd+xvQWF+t2w.user.46.165.242.75.POSTED!not-for-mail
From: Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid>
Newsgroups: fr.comp.os.unix
Subject: Re: bash : fonction min
Date: Tue, 19 Oct 2021 18:16:50 +0200
Organization: =?utf-8?Q?Universit=C3=A9?= de Strasbourg
Message-ID: <87fssx56rx.fsf@universite-de-strasbourg.fr.invalid>
References: <fantome.forums.tDeContes-761FCF.20114318102021@news.free.fr>
	<87k0ia5fn8.fsf@universite-de-strasbourg.fr.invalid>
	<slrnsmtitr.10vf.naddy@lorvorc.mips.inka.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: gioia.aioe.org; logging-data="56369"; posting-host="nwhFLAbnWMrd+xvQWF+t2w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)
Cancel-Lock: sha1:HnEbqPxEtrFcBZSS5ENpU1uREUA=
X-Notice: Filtered by postfilter v. 0.9.2
Bytes: 1844
Lines: 24

Christian Weisgerber <naddy@mips.inka.de> writes:

> On 2021-10-18, Alain Ketterlin

>> 2) if [[ $X < $Y ]]; then ...; else ...; fi
>
> =C3=87a, c'est faux. '<' compare des cha=C3=AEnes de caract=C3=A8res.
> C'est la m=C3=AAme chose en test/[ et [[.
>
> Donc :
>   if [[ $X -lt $Y ]]; ...
>
> Mais on peut se servir d'une commande arithm=C3=A9tique :
>   if (( X < Y )); ...

Absolument. Merci pour la correction.

>> La seconde est sp=C3=A9cifique =C3=A0 bash.
>
> [[ ... ]] et (( ... )) sont des inventions du ksh.
> bash les a copi=C3=A9es.

D'accord, mais je voulais en fait dire : pas POSIX.

-- Alain.