Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > fr.comp.os.unix > #8120

Re: [bash] select

Path csiph.com!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> (permalink)
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=
Xref csiph.com fr.comp.os.unix:8120

Show key headers only | View raw


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 -+-

Back to fr.comp.os.unix | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[bash] select Jo Engo <yl@icite.fr> - 2023-12-09 14:09 +0000
  Re: [bash] select Jo Engo <yl@icite.fr> - 2023-12-09 21:15 +0000
    Re: [bash] select Jo Engo <yl@icite.fr> - 2023-12-09 21:59 +0000
    Re: [bash] select Jo Engo <yl@icite.fr> - 2023-12-10 16:52 +0000
      Re: [bash] select Christian Weisgerber <naddy@mips.inka.de> - 2023-12-11 18:34 +0000
        Re: [bash] select Jo Engo <yl@icite.fr> - 2023-12-13 14:38 +0000
          Re: [bash] select Christian Weisgerber <naddy@mips.inka.de> - 2023-12-13 23:00 +0000
        Re: [bash] select Jo Engo <yl@icite.fr> - 2023-12-14 15:21 +0000
          Re: [bash] select Jo Engo <yl@icite.fr> - 2023-12-14 15:43 +0000
          Re: [bash] select Christophe PEREZ <chris@novazur.fr> - 2023-12-14 18:51 +0000
          Re: [bash] select Christian Weisgerber <naddy@mips.inka.de> - 2023-12-14 18:38 +0000
  Re: [bash] select Christian Weisgerber <naddy@mips.inka.de> - 2023-12-11 18:32 +0000

csiph-web