Xref: utzoo comp.unix.questions:27590 comp.unix.internals:1480 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!tektronix!reed!intelhf!ivan!kumarr From: kumarr@ivan.hf.intel.com (Kumar Ranganathan) Newsgroups: comp.unix.questions,comp.unix.internals Subject: parsing current filename in ex Keywords: ex,vi Message-ID: <1990Dec15.012859.4312@ivan.hf.intel.com> Date: 15 Dec 90 01:28:59 GMT Organization: Industrial Computing Division - Intel Corp. - Hillsboro Or. Lines: 17 I am sourcing a file containing the following ex command script from within a vi edit of file XXX: !ex - %.lst < commands ex will therefore attempt to execute the contents of commands on XXX.lst since the current filename is XXX by default. This is my problem: If I am editing a file called XXX.c in vi and want to execute the contents of commands on XXX.lst, the above sequence of commands will not work since it will try to execute commands on XXX.c.lst and this is not what I wanted. Note that XXX represents an arbitrary file name, not the literal 'XXX'. Any pointers on how to do this will be appreciated.