salut,
on m'a conseillé sur fr.comp.os.linux.configuration de venir ici
je ne capte rien au bash, je fais un mini script test.sh qui contient:
#!/bin/bash
for i in 1 2 3
do
echo $i
done
si je fais ./test.sh j'obtiens l'erreur suivante:
bash: ./test.sh: bad interpreter: No such file or directory
1er problème: ça ne devrait pas marcher tout seul avec seulement ./test.sh
?
si je fais /bin/bash test.sh j'obtiens l'erreur suivante:
'est.sh: line 3: syntax error near unexpected token `do
'est.sh: line 3: `do
2nd problème: do ne passe pas
A noter que si , dans mon script j'ai:
do echo $i
alors ça passe, mais je ne vais pas tout mettre sur une seule ligne quand
même !
Ca passe également si je colle directement le code sous putty puis entrée
(même en mettant le do tout seul sur une ligne).
Ce n'est ni une histoire de caractère spéciaux, de permissions, de chemin
vers l'interpréteur, de sh ou bash , de nom de fichier ou encore de ; en fin
de ligne.
Comment on fait tourner un script bash ? J'ai du rater un truc vraiment de
base...
Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we.
"seb" <seb34@hotmail.com> writes:
salut,
on m'a conseillé sur fr.comp.os.linux.configuration de venir ici
je ne capte rien au bash, je fais un mini script test.sh qui contient:
#!/bin/bash
for i in 1 2 3
do
echo $i
done
si je fais ./test.sh j'obtiens l'erreur suivante:
bash: ./test.sh: bad interpreter: No such file or directory
1er problème: ça ne devrait pas marcher tout seul avec seulement ./test.sh
?
si je fais /bin/bash test.sh j'obtiens l'erreur suivante:
'est.sh: line 3: syntax error near unexpected token `do
'est.sh: line 3: `do
2nd problème: do ne passe pas
A noter que si , dans mon script j'ai:
do echo $i
alors ça passe, mais je ne vais pas tout mettre sur une seule ligne quand
même !
Ca passe également si je colle directement le code sous putty puis entrée
(même en mettant le do tout seul sur une ligne).
Ce n'est ni une histoire de caractère spéciaux,
À voir. Essaye: od -c test.sh
Tu devrais obtenir ceci:
$ od -c /tmp/test.sh
0000000 # ! / b i n / b a s h n f o r
0000020 i i n 1 2 3 n d o n e c
0000040 h o $ i n d o n e n n
0000054
Je parie que tu obtiendras ceci:
$ od -c /tmp/test.sh
0000000 # ! / b i n / b a s h r n f o r
0000020 i i n 1 2 3 r n d o r
0000040 n e c h o $ i r n d o n e r n
0000060 r n
0000062
de permissions, de chemin
vers l'interpréteur, de sh ou bash , de nom de fichier ou encore de ; en fin
de ligne.
Comment on fait tourner un script bash ? J'ai du rater un truc vraiment de
base...
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.
Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we.
ericb
Bonjour,
"seb" writes:
À voir. Essaye: od -c test.sh
Tu devrais obtenir ceci:
$ od -c /tmp/test.sh 0000000 # ! / b i n / b a s h n f o r 0000020 i i n 1 2 3 n d o n e c 0000040 h o $ i n d o n e n n 0000054
Je parie que tu obtiendras ceci:
$ od -c /tmp/test.sh 0000000 # ! / b i n / b a s h r n f o r 0000020 i i n 1 2 3 r n d o r 0000040 n e c h o $ i r n d o n e r n 0000060 r n 0000062
CR-LF contre LF ?
Si c'était ça, bien vu !
-- eric bachard
Bonjour,
"seb" <seb34@hotmail.com> writes:
À voir. Essaye: od -c test.sh
Tu devrais obtenir ceci:
$ od -c /tmp/test.sh
0000000 # ! / b i n / b a s h n f o r
0000020 i i n 1 2 3 n d o n e c
0000040 h o $ i n d o n e n n
0000054
Je parie que tu obtiendras ceci:
$ od -c /tmp/test.sh
0000000 # ! / b i n / b a s h r n f o r
0000020 i i n 1 2 3 r n d o r
0000040 n e c h o $ i r n d o n e r n
0000060 r n
0000062
Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we.
"seb" <seb34@hotmail.com> writes:
ahhh ! c'est ça ! merci !
mais pourquoi pico me génère-t-il des rn à la windows ?
existe-t-il un paramétrage pour gérer ça ?
Je ne sais pas, emacs est si petit comparé aux mémoires et CD
actuels, que je n'utilise plus qu'emacs en toute circonstance.
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.
Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we.