Andrew P. Lentvorski, Jr. wrote:
> 
> On Mar 3, 2005, at 7:08 AM, John H. Robinson, IV wrote:
> 
> >in bash:
> >
> >var=$1
> >VAR=${!var-ThisVarNotSet}
> >if [ .$VAR = .ThisVarNotSet ];
> >  var=PATH
> >  VAR=${!var}
> >fi
> 
> Ummm, in what way does:
> 
> FOO=${MAYBESET:-${ALWAYSDEFAULT}}
> 
> not work in standard sh?
> 
> I mean, that one is right from "csh programming considered harmful".

Yes, that works great to know if MAYBESET is set or not, but if MAYBESET
is set to OTHERVAR (MAYBESET=OTHERVAR) and I want to know if OTHERVAR is
set or not. Think of MAYBESET as an indirect variable.

-john
-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to