6600zeek@hub.UUCP (Josh Pritikin) (01/10/90)
Is there a way to read files on FTP without 'get'ting them first? Can I activate vi and call up a remote file? -- Thanks ________________I hate signatures, and so do you.___________________ |Todd Howitt, AKA Bob & Doug | | |6600zeek@ucsbuxa.ucsb.edu | >This space intentionally left blank< | |6600zeek@ucsbuxa.bitnet | |
emv@math.lsa.umich.edu (Edward Vielmetti) (01/11/90)
In article <3510@hub.UUCP> 6600zeek@hub.UUCP (Josh Pritikin) writes:
Is there a way to read files on FTP without 'get'ting them first? Can I
activate vi and call up a remote file? -- Thanks
If you have a Unix system you can do that, yup, more or less.
Here's the trick, from the SunOS 4.0.3 man page (your mileage
may vary).
2) If the first character of the file name is `|', the
remainder of the argument is interpreted as a shell
command. ftp then forks a shell, using popen(3S) with
the argument supplied, and reads (writes) from the
standard output (standard input) of that shell. If the
shell command includes SPACE characters, the argument
must be quoted; for example `"| ls -lt"'. A particu-
larly useful example of this mechanism is: `dir |
more'.
I.e. you should be able to say
get README "|more"
get ls-lR.Z "|zcat|grep foobie"
etc.
--Ed
bengtl@maths.lth.se (Bengt Larsson) (01/11/90)
In article <3510@hub.UUCP> 6600zeek@hub.UUCP (Josh Pritikin) writes: >Is there a way to read files on FTP without 'get'ting them first? Can I >activate vi and call up a remote file? -- Thanks If you are using BSD Unix ftp, you can give a second parameter to the "get" command. This second parameter is the local file name (the name the file gets stored under on your local machine). If the "local file name" starts with a "|", it is assumed to be a command, and a shell is started up with the rest of the file name used as a command. Examples: ftp> get remotefile |cat ! "cat" the file to the screen ftp> get remotefile |more ! View the file using "more" ftp> get remotefile "|tee localfile|more" ! Store in a file, and view ftp> get xxxx.tar.Z "|zcat|tar xvf -" ! receive a compressed "tar" file, ! uncompress it, and unpack ! the archive, all in one step. You can do quite a lot using this "piping" feature. Note that the second argument to "get" must be quoted if there are spaces in it. Also note that you should "go to end of file" in "more" before you start the next ftp command. I don't think you can view a file using "vi" this way, though. -- Bengt Larsson - Dep. of Math. Statistics, Lund University, Sweden Internet: bengtl@maths.lth.se SUNET: TYCHE::BENGT_L
eps@toaster.SFSU.EDU (Eric P. Scott) (01/11/90)
In article <3510@hub.UUCP> 6600zeek@hub.UUCP (Josh Pritikin) writes: >Is there a way to read files on FTP without 'get'ting them first? Can I >activate vi and call up a remote file? -- Thanks The referenced articles both mention the use of pipes with the get command--but they do not answer the question. You are still _get_ting (RETRing) the file, and it's no less expensive than getting to a local disk file. (If I see a README file that's a few hundred bytes, I may direct output to my terminal, but that's about it. A really nice feature of the TOPS-20 and recent ("version 5") UNIX FTP servers is the ability to say STAT pattern to perform the equivalent of LIST pattern but with output sent over the control connection. It's MUCH faster for short listings.) We use "remote" files all the time--but with NFS mounts rather than FTP. This works pretty well between machines under the same administrative control; it is not a replacement for anonymous FTP because it lacks certain security auditing features (among other things). But it does let you "vi" (or whatever) files. -=EPS=-
eps@toaster.SFSU.EDU (Eric P. Scott) (01/11/90)
Sorry to follow up my own article, but I am reminded that GNU emacs provides ftp-find-file and ftp-write-file commands, and there's even a vi emulator called VIP. (sigh) -=EPS=-