[zsh] read avec un timeout
Bruno Bonfils
asyd at asyd.net
Wed Sep 13 09:06:25 CEST 2006
On mer 13 septembre, arno. wrote:
> Le Sunday 10 September 2006, à 20:52:41PM +0200, Bruno a écrit :
> > Bonjour,
> >
> > Le module zsh/system fourni une fonction sysread (un read simplifié)
> > mais qui permet l'utilisation d'un timeout (en secondes).
> >
> > Exemple :
> >
> > % zmodload zsh/system
> > % param="default" ; echo -n '> ' ; sysread -t 3 param ; echo $param
> > hello (entrée utilisateur)
> > hello
> >
> > % param="default" ; echo -n '> ' ; sysread -t 3 param ; echo $param
> > > zsh: exit 4
> > default
> >
> > Au cas où...
>
> Est-ce qu'il y a une différence avec la commande interne "read" ?
> % param="default" ; echo -n '> ' ; read -t 3 param ; echo $param
Tiens, bizarre, j'avais pourtant regardé je l'avais pas vu ce -t pour
read, au temps pour moi
--
http://asyd.net/home/ - Home Page
http://guses.org/home/ - French Speaking (Open)Solaris User Group
More information about the Shell
mailing list