> >>>>> "Bruce" == Bruce Momjian <[EMAIL PROTECTED]> writes:
>
> Bruce> The proper code is attached. A simple use of ${var1:-var2} does
> Bruce> the trick. LINGUAS is assigned right after the loop anyway, so
> Bruce> there is no need to assign a value to it as part of the for
> Bruce> loop.
>
> Hmm, a late reply, but better than nothing :) Here is what the
> autoconf manual says:
>
> ----------------------------------
> Another nonportable shell programming construction is
> VAR=${VAR:-VALUE}
>
> The intent is to set VAR to VALUE only if it is not already set, but if
> VAR has any value, even the empty string, to leave it alone. Old BSD
> shells, including the Ultrix `sh', don't accept the colon, and complain
> and die. A portable equivalent is
> : ${VAR=VALUE}
> -------------------------------------
Maybe it is fine as it is. Of course, I can't find any reference to
${VAR=VALUE} in either my BSD sh manual, or the bash manual. I can't
imagine they forgot to mention it. However, it seems to do what they
say it does, so it may be OK. I guess they are saying ${VAR:=VALUE}
unconditionally assigns it, and ${VAR=VALUE} assigns it only if VAR is
unset. It is possible that is old syntax, and is not ANSI, so they
don't mention it in the manual pages anymore.
The crux of the problem is using ${VAR=VALUE} inside the loop list
of values. If you just switch it to the equal version, you are fine,
though as I mentioned, you are reassigning it on exit from the loop, so
just the variable alone would do the trick. That is where my OS is
misbehaving, not the actual ${VAR=VALUE} itself.
--
Bruce Momjian | http://www.op.net/~candle
[EMAIL PROTECTED] | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026