Re: [LA-discussions] concaténation de variables bash |
[ Thread Index | Date Index | More linuxarverne.org/discussions Archives ]
On Fri, Nov 28, 2008 at 02:19:40PM +0100, Daniel Cartron wrote: > Le vendredi 28 novembre 2008, Romain Tartière a écrit : > > case $CHOIX in > > chaine[1-6]) echo $po ;; > > esac > > ça me semble intéressant sauf que mes chaines ne sont pas comme ça, c'est > plutôt loulou, riri, fifi, etc. On peut faire aussi avec ça ? Oui: case $CHOIX in loulou|riri|fifi) ... ;; esac voir sh(1): | The syntax of the case command is: | case word in | pattern) list ;; | ... | esac | | The pattern can actually be one or more patterns (see Shell Patterns | described later), separated by `|' characters. The exit code of the case | command is the exit code of the last command executed in the list or zero | if no patterns were matched. > Et le echo $po il fait quoi ? Ben il affiche le contenu de la variable po :-) -- Romain Tartière <romain@xxxxxxxxxxxx> http://romain.blogreen.org/ pgp: 8DAB A124 0DA4 7024 F82A E748 D8E9 A33F FF56 FF43 (ID: 0xFF56FF43) (plain text =non-HTML= PGP/GPG encrypted/signed e-mail much appreciated)
Attachment:
pgpmwRU3assp_.pgp
Description: PGP signature
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |