Re: [linux] Question simple - générateur de séquence de nombres

2006-02-12 Par sujet Thomas Silvestre
il y a aussi une version plus C style:

for ((i=0;i10;i++))
do
  echo $i
done

Le samedi 11 février 2006 à 22:47 +0100, Alain EMPAIN a écrit :
 
 Eric Darchis wrote:
  Bonjour,
  
  Je me pose cette question en moyenne une fois par an et à chaque fois, 
  je galère pour trouver la réponse:
  Il existe sous Linux une commande qui génère une série de nombres. Et je 
  ne me souviens plus de son nom.
  
  C'est tout simple mais extrêmement utile par exemple pour créer 50 
  répertoires:
  for i in `commande 1..50`; do
mkdir repertoire$i
  done
 
 
 start end :
 
 for i in `seq 13 18`
 do echo TRUC.$i
 done
 TRUC.13
 TRUC.14
 TRUC.15
 TRUC.16
 TRUC.17
 TRUC.18
 
 Ou : start increment stop
 -
 for i in `seq 13 2 18`; do echo TRUC.$i; done
 TRUC.13
 TRUC.15
 TRUC.17
 
 Il y a aussi
 
 echo $RANDOM
 qui rend un nombre différent à chaque fois.
 
 Bonne fin de soirée,
 
 Alain
 
 
  Merci de répondre en privé, histoire d'éviter le flood de réponses. Si 
  tout le monde a répondu en privé, je posterai la réponse moi-même.
  
  Ma mémoire défaillante et moi vous remercions d'avance.
  
  Eric.
  
  
  
  
  ___
  Linux Mailing List - http://www.unixtech.be
  Subscribe/Unsubscribe: 
  http://lists.unixtech.be/cgi-bin/mailman/listinfo/linux
  Archives: http://www.mail-archive.com/linux@lists.unixtech.be
  IRC: chat.unixtech.be:6667 - #unixtech
  NNTP: news.gname.org - gmane.org.user-groups.linux.unixtech
 
 ___
 Linux Mailing List - http://www.unixtech.be
 Subscribe/Unsubscribe: http://lists.unixtech.be/cgi-bin/mailman/listinfo/linux
 Archives: http://www.mail-archive.com/linux@lists.unixtech.be
 IRC: chat.unixtech.be:6667 - #unixtech
 NNTP: news.gname.org - gmane.org.user-groups.linux.unixtech

___
Linux Mailing List - http://www.unixtech.be
Subscribe/Unsubscribe: http://lists.unixtech.be/cgi-bin/mailman/listinfo/linux
Archives: http://www.mail-archive.com/linux@lists.unixtech.be
IRC: chat.unixtech.be:6667 - #unixtech
NNTP: news.gname.org - gmane.org.user-groups.linux.unixtech


Re: [linux] Question simple - générateur de séquence de nombres

2006-02-11 Par sujet Alain EMPAIN



Eric Darchis wrote:

Bonjour,

Je me pose cette question en moyenne une fois par an et à chaque fois, 
je galère pour trouver la réponse:
Il existe sous Linux une commande qui génère une série de nombres. Et je 
ne me souviens plus de son nom.


C'est tout simple mais extrêmement utile par exemple pour créer 50 
répertoires:

for i in `commande 1..50`; do
  mkdir repertoire$i
done



start end :

for i in `seq 13 18`
do echo TRUC.$i
done
TRUC.13
TRUC.14
TRUC.15
TRUC.16
TRUC.17
TRUC.18

Ou : start increment stop
-
for i in `seq 13 2 18`; do echo TRUC.$i; done
TRUC.13
TRUC.15
TRUC.17

Il y a aussi

echo $RANDOM
qui rend un nombre différent à chaque fois.

Bonne fin de soirée,

Alain


Merci de répondre en privé, histoire d'éviter le flood de réponses. Si 
tout le monde a répondu en privé, je posterai la réponse moi-même.


Ma mémoire défaillante et moi vous remercions d'avance.

Eric.




___
Linux Mailing List - http://www.unixtech.be
Subscribe/Unsubscribe: http://lists.unixtech.be/cgi-bin/mailman/listinfo/linux
Archives: http://www.mail-archive.com/linux@lists.unixtech.be
IRC: chat.unixtech.be:6667 - #unixtech
NNTP: news.gname.org - gmane.org.user-groups.linux.unixtech


--
 Do something for freedom every day 
* support Open Document Format :
please discover and use OpenOffice (gratis)
* or at least, install it as a converter from open format
to a proprietary one.
Please realize that proprietary formats are important tools
to reinforce a monopoly.
begin:vcard
fn:Dr Alain EMPAIN
n:EMPAIN;Alain
org:University of LIEGE;Euregio ALMA-Grid project
adr;quoted-printable:Avenue de l'H=C3=B4pital, 3;;BAT. B23 GIGA,;Liege 1;;B-4000;Belgium
email;internet:[EMAIL PROTECTED]
title:Bioinformatics 
tel;work:+32 4 366 4497
tel;fax:+32 4 366 2917
tel;home:+32 85 51 2341
tel;cell:+32 497 70 1764
x-mozilla-html:FALSE
version:2.1
end:vcard

___
Linux Mailing List - http://www.unixtech.be
Subscribe/Unsubscribe: http://lists.unixtech.be/cgi-bin/mailman/listinfo/linux
Archives: http://www.mail-archive.com/linux@lists.unixtech.be
IRC: chat.unixtech.be:6667 - #unixtech
NNTP: news.gname.org - gmane.org.user-groups.linux.unixtech