Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Posts
    31

    Unanswered: "Automated" FTP script prompting for password

    Why is it whenever I use this I get prompted for password

    Code:
    FTP_OUTPUT=$(/usr/bin/ftp -i -v -n $FTP_HOST_ADDRESS <<END_FTP
    user $FTP_HOST_USERNAME $FTP_HOST_PASSSWORD
    $FTP_TRANSFER_TYPE
    lcd $PATH_TO_DUMPEDFILES_DIR
    cd $PATH_TO_PUT_DUMPED_FILES_ON_HOST
    put $file_to_ftp
    quit
    END_FTP)


    And whenever I do this:

    Code:
    /usr/bin/ftp -i -v -n $FTP_HOST_ADDRESS <<END_FTP
    user $FTP_HOST_USERNAME $FTP_HOST_PASSSWORD
    $FTP_TRANSFER_TYPE
    lcd $PATH_TO_DUMPEDFILES_DIR
    cd $PATH_TO_PUT_DUMPED_FILES_ON_HOST
    put $file_to_ftp
    quit
    END_FTP
    I get the following error :


    ./myscript.ksh[89]: syntax error at line 190 : `<<' unmatched


    On line 89 I have this :

    Code:
    /usr/xpg4/bin/ls -ltr $PATH_TO_FILES/$file_to_look_for | /usr/xpg4/bin/awk '{print $9}' | while read path_to_found_file
    On line 190 I have this :

    Code:
    /usr/bin/ftp -i -v -n $FTP_HOST_ADDRESS <<END_FTP

    I really don't understand the above error, there is nowhere else in the script where I'm using << except on line 190 (there are no other >> in the script). I have also went through and counted all the ` they all "add-up".
    Last edited by bluwulf; 10-31-05 at 17:16.

  2. #2
    Join Date
    Aug 2004
    Location
    Rome, Italy
    Posts
    81
    use this and maybe it'll work

    -----------------------------------------------
    FTP_OUTPUT() {
    {
    echo "open $FTP_HOST_ADDRESS"
    echo "user $FTP_HOST_USERNAME $FTP_HOST_PASSSWORD"
    echo "$FTP_TRANSFER_TYPE"
    echo "lcd $PATH_TO_DUMPEDFILES_DIR"
    echo "cd $PATH_TO_PUT_DUMPED_FILES_ON_HOST"
    echo "put $file_to_ftp"
    echo "quit"
    } | ftp -nvi
    }

    FTP_OUTPUT
    -----------------------------------------------------
    I hope it works,
    bye by ducasio

  3. #3
    Join Date
    Oct 2004
    Posts
    31
    I kno where I wuz being prompted for a password...my password variable was splet wrong it is suppoze to be $FTP_PASS_WORD not $FTP_PASSS_WORD. I corrected, that but I still get this error :

    Code:
    ./myscript.ksh[89]: syntax error at line 190 : `<<' unmatched
    I however prefer to use :


    Code:
    FTP_OUTPUT=$(/usr/bin/ftp -i -v -n $FTP_HOST_ADDRESS <<END_FTP
    user $FTP_HOST_USERNAME $FTP_HOST_PASSWORD
    $FTP_TRANSFER_TYPE
    lcd $PATH_TO_DUMPEDFILES_DIR
    cd $PATH_TO_PUT_DUMPED_FILES_ON_HOST
    put $file_to_ftp
    quit
    END_FTP)
    because I want the output of the FTP process to be assigned to the $FTP_OUTPUT
    variable for further use....it actually works now. Thanks for your insight though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •