Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    1

    Unanswered: FTP Script Error

    Help! please.

    I have a script named ftpput to which i pass the following arguments:

    ip - server ip
    user - username
    pass - password
    $1 - name of the file


    ftp -n << EOF
    verbose
    open ip
    user user pass
    ascii
    lcd /domino/notesdata50/prod/cantina_files
    put $1
    bye
    EOF

    echo "FTP Terminado"


    when i execute the script it gives an error: File Not Found

    But the file is there, in the directory.

    What am i doing wrong?

  2. #2
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    138
    Hello lux35.

    my first tip is : don´t use $1 for the filename.
    Use File="name of the file"

    In ftp commands use -put $File-

    second tip is : try your commans step by step in comandline by using "ftp"
    Last edited by fla5do; 12-14-03 at 18:24.
    Greetings from germany
    Peter F.

  3. #3
    Join Date
    Dec 2003
    Posts
    4
    he can use $1 if, he runs his program like this:
    ./script.sh file.txt

    now i haven't done scripting in a few months, but i think it'll work if you do it pretty much the way you had it.

    ip = 56.142.565.451
    user = "johnny"
    pass = "passwd"

    ftp -n << EOF
    verbose
    open $ip
    user $user $pass
    ascii
    lcd /domino/notesdata50/prod/cantina_files
    put $1
    bye
    EOF

    echo "FTP Terminado"

    then to run it, it'd be ./script.sh yourfile.txt

Posting Permissions

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