Re: FTP

[prev] [thread] [next] [lurker] [Date index for 2003/12/11]

From: Ben Collver
Subject: Re: FTP
Date: 16:08 on 11 Dec 2003
On Thu, Dec 11, 2003 at 03:49:47PM +0000, Mark Fowler wrote:
> FTP> mv foo bar
> mv: no such command.
> 
> I mean.  What The Hell?  Has no one thought it might be an idea to add
> this?  How difficult can it be?  I've yet to find an operating system
> that runs FTP and can't move files.
> 
> Or has someone added this while I haven't been paying attention and
> decided to call it something other than 'mv'?  I'm not sure which would be
> worse.
> 
> How hard can it be?

Not very hard.  However, FTP is a relatively old program and it was not
developed specifically for Unix.  The commands are typically the same
among CLI clients, and if you read the 2.10 BSD manual (1985):

http://www.freebsd.org/cgi/man.cgi?query=ftp&manpath=2.10+BSD

       rename [ from ] [ to ]
	      Rename the file from on the remote machine, to the file to.


If you are using a more recent BSD, you can fake it with a .netrc file:
# cat >>~/.netrc
default login anonymous password user@site
macdef mv
rename $1 $2

^D
# ftp ftp.foobar.com
$ mv foo bar
quit

Notice the "$ " in the command line.  That is necessary to use the macro.

I think it's easier to just remember that in FTP the command is "rename".

Cheers,

Ben

Generated at 14:02 on 01 Jul 2004 by mariachi 0.52