need help with ftp script
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: need help with ftp script

Hybrid View

  1. #1
    Join Date
    Jan 2001
    Posts
    2,828
    I'm running HP-UX.

    Normally, when you ftp to a host, you are allowed to define a macro, using the macdef command, and execute it with arguments, preceding the macro name with a $.

    But when i attempt to do the same thing from within a shell script, i run into problems.


    ftp daytona < prompt

    macdef test
    lcd $1
    !pwd
    cd $2
    pwd

    $ test /home/ksubrama/ftpsrc /home/kode/ftpdest

    bye
    endl

    ############### End of script ########################################

    When i run this script, ( without the 'prompt', so that i can see the responses ), i find that $1 and $2 are not
    substituted, but are taken as blank spaces.

    If you could help me find out why, i'd be very grateful!!!

    regrads
    hrishy


  2. #2
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809
    try :

    ...
    macdef test
    lcd \$1
    !pwd
    cd \$2
    pwd

    ...

    the pb is that $1 and $2 are interpreted as env variables passed to the ftp command ...

Posting Permissions

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



Click Here to Expand Forum to Full Width