Passing Parameters To FTP Scripts

Passing Parameters To FTP Scripts

Post by Phil Stanle » Sun, 19 Feb 1995 03:24:35



Am very new to SH shell and am trying to pass a file name (which
changes on a daily basis) to an FTP script.  I would like to
execute the script and pipe in the new filename based on the name
piped but, I am not sure where to look for the variable from the
pipe.

Ie.  ftpjob<filename

        fptjob
        ftp ####.#####.#####.####
        user xxxxxx xxxxxx
        put variable.file new.host.variable.file
        quit

where does filename end up when piped into this script?

        $temp, temp,$1, or what?

am using SH shell on SunOS Solaris system

Any help would be greatly appreciated.

Thanks,
A long time MVS/EXEC/DOS/VAX-VMS programer and new Unix scripter

 
 
 

Passing Parameters To FTP Scripts

Post by Clark L. Za » Wed, 22 Feb 1995 14:54:12



>Am very new to SH shell and am trying to pass a file name (which
>changes on a daily basis) to an FTP script.  I would like to
>execute the script and pipe in the new filename based on the name
>piped but, I am not sure where to look for the variable from the
>pipe.
>Ie.  ftpjob<filename
>    fptjob
>    ftp ####.#####.#####.####
>    user xxxxxx xxxxxx
>    put variable.file new.host.variable.file
>    quit
>where does filename end up when piped into this script?

Probably the best way to pass the name is:
       ftpjob filename

then your job would look like:
       ftp ###.#####.#####.####
       user xxxxxx xxxxxx
       put $1 new.host.variable.file
       quit

--


 
 
 

Passing Parameters To FTP Scripts

Post by Andy Davido » Thu, 23 Feb 1995 09:20:26




: >Am very new to SH shell and am trying to pass a file name (which
: >changes on a daily basis) to an FTP script.  I would like to
: >execute the script and pipe in the new filename based on the name
: >piped but, I am not sure where to look for the variable from the
: >pipe.

: >Ie.  ftpjob<filename
: >  fptjob
: >  ftp ####.#####.#####.####
: >  user xxxxxx xxxxxx
: >  put variable.file new.host.variable.file
: >  quit
: >where does filename end up when piped into this script?

: Probably the best way to pass the name is:
:        ftpjob filename
: then your job would look like:
:        ftp ###.#####.#####.####
:        user xxxxxx xxxxxx
:        put $1 new.host.variable.file
:        quit


coincidence. i am relatively new to the shell myself, and i wrote a little
alias today to speed ftp. maybe this will help someone, or someone can help me
improve it? i eventually moved it into a script for more flexibility.

echo -e "user $2\\nmget $3\\nquit"|ftp -ni "$1"

is there a more elegant way of doing this?

-dert

 
 
 

Passing Parameters To FTP Scripts

Post by Timothy J Luo » Sat, 25 Feb 1995 02:06:46


        coincidence. i am relatively new to the shell myself,
        and i wrote a little alias today to speed ftp. maybe
        this will help someone, or someone can help me improve
        it? i eventually moved it into a script for more
        flexibility.

for my money there is no better way to ftp than 'ncftp' which can be found in

ftp://ftp.cs.unl.edu/pub/ncftp/

it allows you to ftp by a very simple format:

ncftp sitename:/path/to/file/you/want

it will auto-login, keep a log of your FTP's, and do a whole host of  
other very convenient things.

If you ftp more than once a week, it will help you do it easier.  
Otherwise you might not notice much difference.

It also compiled very easily. (a big plus for those of us who fear  
compiling with the innermost part of our being)

TjL

--

NeXTStep 3.2 m68k    UNIX workstations         Shell=tcsh 6.05.01
Allegheny College    No Root/super-user access    1 Peter 3:15-16
If I understood the man page I wouldn't have asked the question.

 
 
 

1. Passing Parameters to Korn Shell script

How can I pass parameters to the a Korn Shell script?
(I want to replace the following 2 statements with a single one)
The 'procno' field and the name of the table would be passed.

1. statement
------------------
db2 "SELECT  * ,  '20'  AS procno  FROM  procdb.result1" ;

2.statement
------------------
db2 "SELECT  * ,  '30'  AS procno  FROM  procdb.result2" ;

TIA
Sean

2. /dev/rdsk - help

3. Passing Parameters to Script

4. USB Sound Card: RedHat Supported?

5. Auto-Passing of positional parameters from flatfile to SHELL Script

6. FreeBSD equivalent of Linux's "loadlin"?

7. Pass wildcard parameter to script

8. C preprocessor

9. Can't pass parameter to ksh script

10. passing parameters in shell scripts

11. ftp parameter passing????

12. [Solaris] problem to pass parameter "*" in a script

13. Passing Parameters to Sed as if it was a Shell Script