From owner-freebsd-questions@FreeBSD.ORG Sun Apr 27 16:54:30 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05BED37B401 for ; Sun, 27 Apr 2003 16:54:30 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5AD6B43FA3 for ; Sun, 27 Apr 2003 16:54:29 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id h3RNsMiN048460; Sun, 27 Apr 2003 18:54:22 -0500 (CDT) (envelope-from dan) Date: Sun, 27 Apr 2003 18:54:22 -0500 From: Dan Nelson To: Raphael Marmier Message-ID: <20030427235420.GC22259@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.4i cc: freebsd-questions Subject: Re: can't set a variable with a dash in its name!! X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2003 23:54:30 -0000 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=yes", or "make -DWITH_COURIER-IMAP", or edit the port Makefile or /etc/make.conf and set "WITH_COURIER-IMAP=yes" 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. -- Dan Nelson dnelson@allantgroup.com