Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!umich!samsung!cs.utexas.edu!uunet!mcsun!sunic!lth.se!newsuser From: bengtl@maths.lth.se (Bengt Larsson) Newsgroups: news.newusers.questions Subject: Re: Viewing text files on FTP Message-ID: <1990Jan11.001956.27910@lth.se> Date: 11 Jan 90 00:19:56 GMT References: <3510@hub.UUCP> Sender: newsuser@lth.se (LTH network news server) Reply-To: bengtl@maths.lth.se (Bengt Larsson) Organization: Lund Institute of Technology, Sweden Lines: 33 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