Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ukma!uunet!munnari!otc!metro!basser!john From: john@basser.UUCP Newsgroups: comp.unix.wizards Subject: Re: vi tips- summary number one Message-ID: <1034@basser.oz> Date: Wed, 30-Sep-87 11:50:24 EDT Article-I.D.: basser.1034 Posted: Wed Sep 30 11:50:24 1987 Date-Received: Sat, 3-Oct-87 09:25:16 EDT References: <601@augusta.UUCP> <8524@mimsy.UUCP> <2280@sphinx.uchicago.edu> <86@physiol.su.oz> Reply-To: john@basser.oz (John Mackin) Distribution: world Organization: Dept of Comp Sci, Uni of Sydney, Australia Lines: 23 Summary: :r !command In article <86@physiol.su.oz> daved@physiol.su.oz (Dave Davey) writes: > In article <2280@sphinx.uchicago.edu>, d757@sphinx.uchicago.edu (Lawrence Lerner) writes: > > !! place results of command into file i.e. !!cat it.p will place > > the list of it.p in your file. > This isn't quite right. '!' is a command which, in common with 'd', 'c' and > 'y' can be followed by a cursor motion command. [...] It's not an effective > alternative to ":r file" unless you are purposely trying to clobber > some text at the same time. Dave's comments are entirely correct. I would just like to add one more point: in the ":r" command, the filename can start with a ! character, in which case it is taken as a command to be executed and the standard output of the command is read into the buffer. This is how you can accomplish the effect the original poster wanted. You can also use the ":w !command" construct, which writes the addressed lines (the whole file by default) down the given command's standard input. John Mackin, Basser Department of Computer Science, University of Sydney, Sydney, Australia john@basser.oz.AU (john%basser.oz.AU@UUNET.UU.NET) {uunet,hplabs,mcvax,ukc,nttlab}!munnari!basser.oz!john