Deutsch English Français Italiano |
<ul2ld2$d5$4@rasp.pasdenom.info> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!pasdenom.info!.POSTED.2a01:e34:ecb6:4110:3701:cee3:eca5:7e2a!not-for-mail From: Jo Engo <yl@icite.fr> Newsgroups: fr.comp.os.unix Subject: Re: [bash] select Date: Sat, 9 Dec 2023 21:15:14 -0000 (UTC) Organization: <http://pasdenom.info/news.html> Message-ID: <ul2ld2$d5$4@rasp.pasdenom.info> References: <ul1sek$d5$2@rasp.pasdenom.info> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 9 Dec 2023 21:15:14 -0000 (UTC) Injection-Info: rasp.pasdenom.info; posting-account="yl@usenet"; posting-host="2a01:e34:ecb6:4110:3701:cee3:eca5:7e2a"; logging-data="421"; mail-complaints-to="abuse@pasdenom.info" User-Agent: Pan/0.155 (Kherson; fc5a80b8) Cancel-Lock: sha1:4SJgI0izedGOzawh37oP4nMXg2M= sha256:d0qwskFQI8Hy+iEiPIPOatLo3FN7qkPAjhigkSsvXG4= sha1:IHOcf5Bsaqpkxv+42XcfH8kEExo= sha256:Ht6nrmpk2giJzS7m1aeKJQTHqOhZPEGL728jtb1grQQ= Bytes: 1742 Lines: 29 Le Sat, 9 Dec 2023 14:09:24 -0000 (UTC), Jo Engo a écrit : > <code> > select toto in $(sed "s/^/\"/;s/$/\"/" menu); do echo $toto; done </> Bon ça, donc, ça ne marche pas. J'ai trouvé un « solution » que je ne trouve pas du tout élégante mais qui « marche » : (pour tester) #!/bin/bash read -p "fichier de menu : " # attention, il y a bien un saut de ligne entre les quotes IFS=' ' select item in $(cat $filee) do echo $item # faire des trucs done # fin script Quelqu'un a quelque chose de mieux à me proposer ? -- Si l'électron nous a servi à comprendre beaucoup de choses, nous n'avons jamais bien compris l'électron lui-même. -+- Louis de Broglie -+-