On Tue, Feb 17, 2004 at 08:48:45AM +0000, Tom Fogg wrote:
> I've been trying to create an 'edit' command that will approximate me 
> being able to edit a file directly on an sftp server without leaving 
> lftp (a useful thing for web developers). Due to there not being 
> parameter symbols in the lftp aliases its a bit convoluted and i 
> wondered if anyone had a nicer solution.
> 
> So far i have a shell script in ~/.lftp called edit.sh which does this:

lftp-3.0.0 will have `source -e' command which would execute commands
printed by external script. You would be able to do:

        alias edit source -e ~/.lftp/edit.sh

edit.sh would contain:
> #!/bin/sh
> tempid=$$
> echo get $1 -o /tmp/$tempid$1
> echo shell vim /tmp/$tempid$1
> echo put -E /tmp/$tempid$1 -o $1

Then `edit file' would download, edit the file and upload it back.

-- 
   Alexander.

Reply via email to