This is a discussion on #why following cannot be execute? within the Shell scripting forums, part of the Development/Scripting category; following script first get target script on ftp server, then execute it. but actually, this script will end after command ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
following script first get target script on ftp server, then execute it.
but actually, this script will end after command line "bye", the statement after it wil not be executed. what's wrong and how to resolve, I currently seprate it to two scripts, works well but I am not satisfy it. ###########################################Start #!/bin/bash filename=$1 ftp -nv <<! open 10.10.10.10 user anonymous 111@111.com ascii get $filename close bye ! #why following cannot be execute? clear echo -e " \n Have download filerun from 10FTP to /test/ryan " exit 0 ########################end |
| Sponsored Links | ||
|
|
|
||||
|
Replace ! with EOS (END OF SCRIPT OR FTP). That should help i guess
###########################################Start #!/bin/bash filename=$1 ftp -nv <<EOS open 10.10.10.10 user anonymous 111@111.com ascii get $filename close bye EOS #why following cannot be execute? clear echo -e " \n Have download filerun from 10FTP to /test/ryan " exit 0 ########################end |
|
|||
|
I think script should be as follows:
Code:
HOST="my.dot.com" FTPU="anonymous" FTPP="me@my.dot.com" filename=$1 ftp -n $HOST <<! quote USER $FTPU quote PASS $FTPP ls pwd lcd get $filename quit ! clear echo -e " \n Have download filerun from 10FTP to /test/ryan " exit 0 |
|
|||
|
Quote:
Yo también tenÃÂ*a ese mismo problema, y probé lo que le sugirieron a ryan, pero no funcionó, al final probé el EOF y esto si funcionó. Gracias, Tatin |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| If file modified execute a script | karabaja | Shell scripting | 3 | 11-23-2006 03:39 AM |