simple shell scripting question

2002-10-07 Thread Matt Price

hi everyone,

just trying to learn how to do shell scription, assigned myself a
simple task:

I have a webstie which I manage both from home (mac) and work
(woody).  I use sitecopy at work but my access is only via ftp, so
sitecopy can't identify newer files on the website.  So after I
upsdate the site form home,  I usually log in to my work ocmputer and
immediately ftp the new site files over.  This can be slightly
tedious, and I would like to be able to do this in just one command.
so I'd like to be able to do this:

ftp -i origin.chass.utoronto.ca

cd public_html
mget * */* */*/*
quit



unfortunately the last three commands have to be entered on the ftp
command line, far as I can tell.  so: is there a way to pass these
instructions on to ftp from a shell script?  I imagine this must be a
very ocmmon question...  

thanks for your help, sorry if this is a little OT.  

matt


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: simple shell scripting question

2002-10-07 Thread Thorsten Haude

Hi,

* Matt Price <[EMAIL PROTECTED]> [02-10-07 23:44]:
>I have a webstie which I manage both from home (mac) and work
>(woody).  I use sitecopy at work but my access is only via ftp, so
>sitecopy can't identify newer files on the website.  So after I
>upsdate the site form home,  I usually log in to my work ocmputer and
>immediately ftp the new site files over.  This can be slightly
>tedious, and I would like to be able to do this in just one command.
>so I'd like to be able to do this:

I'm pretty sure that sitecopy can help you. Maybe you can find
something in the manpage.
If not, you should have a look at wget, which is a non-interactive
ftp-client.

Thorsten
-- 
Scully: Do you have a theory?
Mulder: I have plenty of theories.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: simple shell scripting question

2002-10-07 Thread Michael Heironimus

On Mon, Oct 07, 2002 at 05:44:53PM -0400, Matt Price wrote:
> command line, far as I can tell.  so: is there a way to pass these
> instructions on to ftp from a shell script?  I imagine this must be a

The first thing I'd suggest is using one of the script-oriented FTP
tools that was designed to work this way, like "ncftpput". But to answer
your general question, there's a shell construct called a "here script".
It works like this:

command_needing_input <


Re: simple shell scripting question

2002-10-07 Thread Matt Price

Michael,
thanks for the ref to ncftpput.  I'l\l look into that and lftp, as
someone else suggested.  But re: the here script:  does this work if I
write it ina simple shell script?  That is do I write a script thus:
cd ~!/website
ftp -i origin.chass.utoronto.ca< On Mon, Oct 07, 2002 at 05:44:53PM -0400, Matt Price wrote:
> > command line, far as I can tell.  so: is there a way to pass these
> > instructions on to ftp from a shell script?  I imagine this must be a
> 
> The first thing I'd suggest is using one of the script-oriented FTP
> tools that was designed to work this way, like "ncftpput". But to answer
> your general question, there's a shell construct called a "here script".
> It works like this:
> 
> command_needing_input < input 1
> input 2
> ..
> EOF
> 
> You can actually do this at the command line if you want to try it out.
> 
> -- 
> Michael Heironimus
> 
> 
> -- 
> To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: simple shell scripting question

2002-10-07 Thread Colin Watson

On Mon, Oct 07, 2002 at 07:03:25PM -0400, Matt Price wrote:
> But re: the here script:

They're actually usually called "here documents" or "heredocs".

> does this work if I write it ina simple shell script?

Yes.

> That is do I write a script thus:
> cd ~!/website

That ! looks odd ... did you mean that?

> I seem to be getting an error (command not found)

What's the full error output?

Cheers,

-- 
Colin Watson  [[EMAIL PROTECTED]]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]