Date: Mon, 28 Apr 2003 23:26:44 +0200 From: Raphael Marmier <raphael@computer-rental.ch> To: Dan Nelson <dnelson@allantgroup.com> Cc: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: can't set a variable with a dash in its name!! Message-ID: <1C375D56-79C0-11D7-ADE2-000393D67E4A@computer-rental.ch> In-Reply-To: <20030427235420.GC22259@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
thanks again! Unfortunatly that doesn't seem to fix. It looks like the way we set the=20= variable doesn't help it, it just gets ignored one way or another. Removing the dash in all instance of the variable in the Makefile=20 worked. It looks like a variable is a variable, even when set from=20 within make. After a bit of looking around, it looks like only csh and tcsh wheren't=20= compliant and allowed dashes. Raphael Le lundi, 28 avr 2003, =E0 01:54 Europe/Zurich, Dan Nelson a =E9crit : > In the last episode (Apr 28), Raphael Marmier said: >> On a freshly installed 4.8, while trying to install the mail/imp3 >> port, I realised that it was impossible to define the following >> variable, either in tcsh or sh: >> >> re# setenv WITH_COURIER-IMAP >> setenv: Syntax Error. >> re# setenv WITH_COURIERIMAP >> re# >> >> re# sh >> # export WITH_COURIER-IMAP >> export: WITH_COURIER-IMAP: bad variable name >> # export WITH_COURIERIMAP >> # >> >> I just tried on 4.6.2 and it works, as well as MacOSX. > > Try "make WITH_COURIER-IMAP=3Dyes", or "make -DWITH_COURIER-IMAP", or > edit the port Makefile or /etc/make.conf and set > "WITH_COURIER-IMAP=3Dyes" in there. Basically, that's not a valid = shell > variable, so you have to set it from within make. > > Posix says: > > Environment variable names used by the utilities in the Shell and > Utilities volume of IEEE Std 1003.1-2001 consist solely of > uppercase letters, digits, and the '_' (underscore) from the > characters defined in Portable Character Set and do not begin with > a digit. Other characters may be permitted by an implementation; > applications shall tolerate the presence of such names. > > The primary problem with the dash is that /bin/sh uses that in = variable > expansion: > > ${parameter:-word} > Use Default Values. If parameter is unset or null, the > expansion of word is substituted; otherwise, the value of > parameter is substituted. > > In the parameter expansions shown previously, use of the colon in > the format results in a test for a parameter that is unset or = null; > omission of the colon results in a test for aparameter that is = only > unset. > > --=20 > Dan Nelson > dnelson@allantgroup.com > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to=20 > "freebsd-questions-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1C375D56-79C0-11D7-ADE2-000393D67E4A>