Ftp sous shell
tontonswell
-
dubcek Messages postés 19021 Statut Contributeur -
dubcek Messages postés 19021 Statut Contributeur -
Bonjour,
j'ai un script shell, pour une transaction ftp qui fait ça:
if [ $mavariable -eq $cekejeveux ]
then
ftp machine 21 <<-EOF
cd "rep"
binary
dir
quit
EOF
else
#The -EOF is there to remove the tabs
ftp machine 21 <<-EOF
cd "rep"
binary
dir
quit
EOF
fi
mais il me renvoie cette erreur:
./ftp[5]: syntax error at line 8 : `<<' unmatched
Je sais qu'il s'agit normalement d'un problème de tabulations...
Quelqu'un a une idée?
Merci d'avance
j'ai un script shell, pour une transaction ftp qui fait ça:
if [ $mavariable -eq $cekejeveux ]
then
ftp machine 21 <<-EOF
cd "rep"
binary
dir
quit
EOF
else
#The -EOF is there to remove the tabs
ftp machine 21 <<-EOF
cd "rep"
binary
dir
quit
EOF
fi
mais il me renvoie cette erreur:
./ftp[5]: syntax error at line 8 : `<<' unmatched
Je sais qu'il s'agit normalement d'un problème de tabulations...
Quelqu'un a une idée?
Merci d'avance
A voir également:
- Ftp sous shell
- Classic shell - Télécharger - Personnalisation
- Core ftp - Télécharger - Téléchargement & Transfert
- Typsoft ftp server - Télécharger - Téléchargement & Transfert
- Classic shell c'est quoi ✓ - Forum Windows 8 / 8.1
- Classic shell ✓ - Forum Windows 10
5 réponses
ne serait-ce pas <<- ?
The format of here-documents is:
...
<<[-]word
here-document
delimiter
....
If the redirection operator is `<<-', then all leading tab characters are stripped from input lines and the line containing delimiter. This allows here-documents within shell scripts to be indented in a natural fashion.
tu sous-entenderais donc :
if [ $mavariable -eq $sketuveux ]
then
#The -EOF is there to remove the tabs
<<-EOF
ftp machine 21
cd "rep"
binary
dir
quit
EOF
else
#The -EOF is there to remove the tabs
<<-EOF
ftp machine 21
cd "rep"
binary
dir
quit
EOF
J'ai essayé, mais rien, on dirait kil prend pas en compte la commande
if [ $mavariable -eq $sketuveux ]
then
#The -EOF is there to remove the tabs
<<-EOF
ftp machine 21
cd "rep"
binary
dir
quit
EOF
else
#The -EOF is there to remove the tabs
<<-EOF
ftp machine 21
cd "rep"
binary
dir
quit
EOF
J'ai essayé, mais rien, on dirait kil prend pas en compte la commande
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question