Erreur dans ce script shell

Fermé
touf_truc Messages postés 57 Date d'inscription samedi 21 octobre 2006 Statut Membre Dernière intervention 23 avril 2007 - 30 janv. 2007 à 18:34
jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 - 31 janv. 2007 à 09:15
1)le premier:

#!/bin/sh
DIALOG=dialog

$DIALOG --backtitle "MENU DE COMPILATION" \
--title "COMPILATION" \
--radiolist "Faites votre choix : " 0 0 0 \
"Hello1.c" "Compilation programme Hello1." off \
"Hello2.c" "Compilation programme Hello2." off \
"Hello3.c" "Compilation programme Hello3" off 2>/tmp/checklist.tmp.$$

retval=$?
choix=`cat /tmp/checklist.tmp.$$`
rm -f /tmp/checklist.tmp.$$

case $retval in
0) case $choix in
Hello1.c) gcc -o hello1 hello1.c
./hello1
;;
Hello2.c) gcc -o hello2 hello2.c
./hello2
;;
Hello3.c) gcc -o hello3 hello3.c
./hello3
;;
esac
;;
*)
echo "Programme arrêté...";;
esac


2)le deuxieme:

#!/bin/bash
DIALOG=${DIALOG=dialog}
FILE='$DIALOG --stdout --title "Choisir un fichier" --fselect $HOME/ 14 48'
gcc -o ${FILE%.c} ${FILE} && ./${FILE%.c}

1 réponse

jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 4 895
31 janv. 2007 à 09:15
Salut,

C'est un peu juste au niveau des explications... :-\

Bon, c'est pô grave ;-)

Dans le 1er, GNU/Linux est très sensible à la casse, donc si ton programme s'appelle "Hello1.c" (avec une majuscule) et que tu l'appelles par "hello1.c" (sans majuscule), ben c'est sûr, ça le fait pas !

Pour le 2nd par contre je vois pas ce qui cloche, d'autant plus que ... c'est pas ce que tu disais là ?!

;-))
0