Le 25 Jun 2003 14:28:05 +0200, Pierre Crescenzo <[EMAIL PROTECTED]> a écrit :

> Bonjour,
> 
> [woody] J'aimerais empêcher bash de se fermer sur un Ctrl-d. Il me
> semble qu'une option permet d'indiquer un tel comportement mais je ne la
> retrouve pas.
> 
> Merci.
> 

        Salut,

  Pour faire cela, il suffit de changer le caractère de fin de fichier
avec stty : 
$ stty -a
 speed 38400 baud; rows 24; columns 80; line = 192;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
                                             ^^^^^^^^
                                             ce qui t'intéresse !
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

et pour le changer :
$ stty eof ^O
pour dire que c'est Ctrl-O  (attention, il faut bien taper un ^ et un O, pas le 
caractère de contrôle !)

        Fred.

-- 
Frédéric Boiteux  -  Calistel

Répondre à