How to execute !$var under csh?

Jim Burns gt0178a at prism.gatech.EDU
Thu Oct 11 16:08:14 AEST 1990


in article <2234 at lri.lri.fr>, js at lri.lri.fr (Jose Lopes De Siqueira) says:


> 	If I set a variable var with a command number, I would like to be able
> to execute it as !$var. However, the ! command interpretes $ as the last
> command string rather than what I expected it to do. How to overcome this
> problem?

How about:

eval \!$var

Beware tho', that when I tried it, if the selected command was an alias
that itself sets a variable, (like an alias for 'cd' that sets the
prompt), you may not get what you want.
-- 
BURNS,JIM
Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
Internet: gt0178a at prism.gatech.edu



More information about the Comp.unix.questions mailing list