${PARAM-'echo word'} vs ${PARAM='echo word'}

Kevin Braunsdorf ksb at j.cc.purdue.edu
Fri Jan 6 13:58:10 AEST 1989


[Yes, I know that one of them assignes... that is not the point of this note.]

I want an environment variable `ROFF' to be an nroff/troff/DITroff
command (if set).  I want the default to be `nroff -man' so I try:

	${ROFF-'nroff -man'} $file

to which the shell replys
	sh: nroff -man: not found

clever me tries

	${ROFF='nroff -man'} $file

and it works!  But *only* on 1/2 of the machines I try it on.

What is the correct way to get what I want?  (eval is ugly as far as I see.)

I'll summarize, of course.
TNX.
--
"I think therefore I am, I thunk therefore I call-by-name!"
kayessbee, Kevin Braunsdorf, ksb at j.cc.purdue.edu, pur-ee!ksb



More information about the Comp.unix.wizards mailing list