Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    4

    Unanswered: FTP script problem

    I'm new unix enviroment, and I have mamnaged to wrote a script to ftp a file from a remote machine.
    My problem when the ftp has executed all other lines in the script are ignored and script exits. The message "file transfer has completed" is not displayed and date . Below is my sample script.

    Please tell me what I am doing wrong here.

    #!/bin/ksh
    userString="brsgadmin"
    pswdString="brsg6906"
    #ifmsdir="NSPPRO_USR1:[USERS.IFMS.BRSGADMIN]"
    ifmsfile="COPY_DB_STATUS.DAT"
    ftp -in ba0470.optus.com.au <<-END_FTP
    user $userString $pswdString
    get ${ifmsfile}
    quit
    -END_FTP

    echo "file transfer has completed"
    date

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    AFAIK, FTP does not take input from STDIN.
    You'll need to find & install a freeware product called "expect".
    It successfully interoperates with FTP.


    YMMV & HTH

Posting Permissions

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