Erreur dans ce script shell
touf_truc
Messages postés
57
Date d'inscription
Statut
Membre
Dernière intervention
-
jipicy Messages postés 40842 Date d'inscription Statut Modérateur Dernière intervention -
jipicy Messages postés 40842 Date d'inscription Statut Modérateur Dernière intervention -
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}
#!/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}
A voir également:
- Erreur dans ce script shell
- Classic shell - Télécharger - Personnalisation
- Script vidéo youtube - Guide
- Mas script - Accueil - Windows
- Erreur 0x80070643 - Accueil - Windows
- Erreur 4101 france tv - Forum Lecteurs et supports vidéo
1 réponse
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à ?!
;-))
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à ?!
;-))