Bonjour,
MA CONFIG: BackTrack 3, KDE 3.5.7, Linux BT 2.6.21.5, Bash 3.1.17.
Sous cette config mon script "menu.sh" génère quelques erreurs.
http://www.airfirst.ch/b2/menu.sh
Voir l'output plus bas.
Comment les résoudre?
1. L'erreur sur la 1ère ligne: -bash: ./menu.sh: /bin/bash^M: bad interpreter: No such file or directory
2. Les erreur d'affichage des commandes: 03,05,06,08,11. Il s'emble que ça ne concerne que les chaine qui ont quelque chose après une variable !!!
3. L'erreur sur la ligne 31 (dans le bloc "case").
4. Question à 10000 points !!!!!
Que pourrait être la raison (à s'arracher les cheveux) de ceci: - Teste du menu1.sh, OK sans erreur.
http://www.airfirst.ch/b2/menu1.sh
http://www.airfirst.ch/b2/outpu_menu1.txt
- Avec l'éditeur Kate, Copier tout le contenu de meni1.sh et coller dans menu.sh vide.
- Teste de menu.sh done l'erreur: -bash: ./menu.sh: /bin/bash^M: bad interpreter: No such file or directory
Qui puis-je maudire: Linux, Bash ou ... ?????
Merci
STEP_A
bt Desktop # menu.sh
-bash: ./menu.sh: /bin/bash^M: bad interpreter: No such file or directory
STEP_B: I remove the 1st line
bt Desktop # menu.sh
: command not found
: command not found
./menu.sh: line 13: menu: command not found
********************* TEST MENU
INIT
01 ls
02 dir eth1
-alldir eth1
04 iwlist eth1
scaniwlist eth1
mode monitor eth1
07 echo start eth1
up hw ether 50:41:32:23:14:05
MAIN
09 Set ESSID: []
10 Set BSSID: []
eth1echo --write file
12 echo --test -e -a eth1
Choix? 01
': not a valid identifier `com
'/menu.sh: line 31: syntax error near unexpected token `in
'/menu.sh: line 31: ` case "$com" in
STEP_C: I replaced "$CN1" by its value "eth1" for commands 03,05,06,08,11.
bt Desktop # menu.sh
: command not found
: command not found
./menu.sh: line 13: menu: command not found
********************* TEST MENU
INIT
01 ls
02 dir eth1
03 dir eth1 -all
04 iwlist eth1
05 iwlist eth1 scan
06 iwconfig eth1 mode monitor
07 echo start eth1
08 ifconfig eth1 up hw ether 50:41:32:23:14:05
MAIN
09 Set ESSID: []
10 Set BSSID: []
eth1echo --write file
12 echo --test -e -a eth1
Choix? 01
': not a valid identifier `com
'/menu.sh: line 31: syntax error near unexpected token `in
'/menu.sh: line 31: ` case "$com" in