Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!mcnc!rti!tijc02!djm408 From: djm408@tijc02.UUCP (David Marks ) Newsgroups: comp.editors Subject: re: Yet another vi question (summary) Message-ID: <267@tijc02.UUCP> Date: 5 Oct 88 15:12:34 GMT Organization: Texas Instr., Johnson City TN Lines: 68 I recently posted the following to this newsgroup: >How does one enter vi to edit a particular file, and upon entry pull >in a template to use as a fill in the blank form? For example, let us say I >want to create a report called myreport, and the standard template is stored >in template.rpt. I tried the following (and variations thereof) > > vi +'r template.rpt' myreport > >It thinks that I want to edit two files (template.rpt, and myreport) and says >so, but somehow while building the buffer it core dumps! I also tried putting >"r template.rpt" in the EXINIT environment variable and/or in the .exrc file. >It still doesn't work. > >I would like to do this so that I can automate a reporting system we use for >software modifications/bugs by giving developers vi to edit the report while >forcing them to use the template (no flames here please! They can always >erase the template if they don't want it with ":1,$d". :-) ) ------------------------------------------------------------------------------- Most responded with variations of vi +'r template.rpt' myreport including changing the single quotes to double quotes, or adding ":0" in front of the "r" command, etc. None of these work on the system I am using: SYSTEM V Rel. 2.2 ported to the VAX8600 by UNIQ DIGITAL. If one of these variations works on yours then you have a different vi than the one we use here. ------------------------------------------------------------------------------- A few suggested I copy the template over to a file called "myreport" and then edit it, or read in the template from the ex command line at the bottom of the vi screen. I am trying to avoid this so that I can run vi from a program with a fork/exec automatically. If our developers have to remember to read in the template when they enter vi in the reporting system, they will most likely forget and not use it. We are trying to standardize our bug reports. ------------------------------------------------------------------------------- One person actually knew what he was saying and told me that this cannot be done with vi unless the target file "myreport" already exists (even if it is blank :-) ). This appears to be true on our system. ------------------------------------------------------------------------------- Thanks to all that responded. It appears that what I want to do cannot be done with vi (unless I copy the template over to the target file or create a blank target first). I consider this a serious bug (I'm not sure if this is a design or implementation bug), as all manuals and books that I have read about vi claim that it can run ANY ex command on entry to vi. Not one mentions any exceptions. ----------------------------------------------------------------------------- #include | LIFE IS NOT A MALFUNCTION! - Number 5 ____ ____ _ _ __ ____ ____ _ _ ____ ____ _ _ ____ / / / / | / / / / / //_// / / / / / / /___ / / /---/ |/ / / / / / / / /---/ /---\ / \ / ~~~~ ~ ~ ~ ~~ ~~~~ ~~~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~~~~ Pony Express: | Electric Avenue: ============= | ================ David J. Marks | ...!mcnc!rti!tijc02!djm408 Texas Instrument | M/S 3520 | Ma Bell: Erwin Highway/P. O. Drawer 125 | ======== Johnson City, TN. 37605 | 615-461-2074