Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!samsung!olivea!orc!inews!iwarp.intel.com!gargoyle!ddsw1!dattier From: dattier@ddsw1.MCS.COM (David W. Tamkin) Newsgroups: comp.editors Subject: Re: including filename with vi Summary: and if you aren't using csh ... Message-ID: <1990Nov05.055022.3188@ddsw1.MCS.COM> Date: 5 Nov 90 05:50:22 GMT References: <484@ssc.UUCP> Reply-To: dattier@ddsw1.MCS.COM (David W. Tamkin) Organization: Contributor Account at ddsw1, Wheeling, Illinois Lines: 22 Dan_Bloch@TRANSARC.COM wrote in : | To insert the filename as it was given to vi: | | :r !echo % | | To insert the current pathname followed by this: | | :r !echo $cwd/% The second suggestion is rather csh-specific. In sh or ksh, :r !echo $PWD/% is the equivalent, but the current directory will get named twice if vi was given the full pathname. [That might happen with Dan's suggestion as well; I know nothing about csh, but I get the feeling it would.] $cwd|$PWD will genrally match the directory % is in if % is not a full path. If you have a command available that gives full paths for files (let's call it "path" for the example), then :r !path % should work regardless of which shell you're using. David Tamkin Box 7002 Des Plaines IL 60018-7002 708 518 6769 312 693 0591 MCI Mail: 426-1818 GEnie: D.W.TAMKIN CIS: 73720,1570 dattier@ddsw1.mcs.com