parsing current filename in ex
Kumar Ranganathan
kumarr at ivan.hf.intel.com
Sat Dec 15 12:28:59 AEST 1990
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.
More information about the Comp.unix.internals
mailing list