lftp and scripts
Hi, Can anyone give me some examples of how to combine lftp script commands with shell script commands. I'd like to be able to re-direct the output of certain commands such that decisions can be made based on the output. I'd also like to be able to generate a list, eg. subdirectories, and process them in a 'for NAME [in WORDS ... ;] do COMMANDS;' kind of way. Regards, Scott.
Re: lftp and scripts
Hi, Can anyone give me some examples of how to combine lftp script commands with shell script commands. I'd like to be able to re-direct the output of certain commands such that decisions can be made based on the output. I'd also like to be able to generate a list, eg. subdirectories, and process them in a 'for NAME [in WORDS ... ;] do COMMANDS;' kind of way. As far as I know, there is no way of doing this in lftp.
Re: lftp and scripts
On Wed, Aug 14, 2002 at 10:22:06PM +0200, Nicolas Noble wrote: Can anyone give me some examples of how to combine lftp script commands with shell script commands. I'd like to be able to re-direct the output of certain commands such that decisions can be made based on the Well, you can redirect many commands, but lftp doesn't have any conditionals except || and . output. I'd also like to be able to generate a list, eg. subdirectories, and process them in a 'for NAME [in WORDS ... ;] do COMMANDS;' kind of way. As far as I know, there is no way of doing this in lftp. Hmm. There's no 'for' construct in lftp. You could do this explicitely, with a script that takes WORDS as stdin, has a hardcoded NAME and outputs an unrolled loop on stdout. (Or takes NAME as argv[1].) 'source' the result. Not very clean, though. -- Glenn Maynard