Le Vendredi, 2 Avril 2004 14.30, Bruno Crochet a �crit :

> je voudrai utiliser les caract�res "fleche" du clavier dans une boucle 
> (Bash) du genre :
> 
> while read -s -n 1 key ; do
>       case $key in
>       a ) command1 ;;
>       b ) command2 ;;
>       esac
> done
> 
> 
> Est-ce possible ?

Bien sur:

#! /bin/bash

while read -s -n 1 key ; do
   case $key in
      [A] ) echo fleche en haut ;;
      [B] ) echo fleche en bas ;;
      [C] ) echo fleche a droite ;;
      [D] ) echo fleche a gauche ;;
   esac   
done

Voir  man bash

Dom

_______________________________________________
gull mailing list
[EMAIL PROTECTED]
http://lists.alphanet.ch/mailman/listinfo/gull

Répondre à