From owner-freebsd-questions Thu Dec 12 7:46:41 2002 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 BDD1037B401 for ; Thu, 12 Dec 2002 07:46:39 -0800 (PST) Received: from mail.bellavista.cz (mail.bellavista.cz [62.168.44.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 972F943EB2 for ; Thu, 12 Dec 2002 07:46:35 -0800 (PST) (envelope-from neuhauser@bellavista.cz) Received: from freepuppy.bellavista.cz (freepuppy.bellavista.cz [10.0.0.10]) by mail.bellavista.cz (Postfix) with ESMTP id 13A285C; Thu, 12 Dec 2002 17:42:50 +0100 (CET) Received: by freepuppy.bellavista.cz (Postfix, from userid 1001) id CEEED2FDAD7; Thu, 12 Dec 2002 16:46:20 +0100 (CET) Date: Thu, 12 Dec 2002 16:46:20 +0100 From: Roman Neuhauser To: Paul Murphy Cc: FreeBSD Questions Subject: Re: Shell variables Message-ID: <20021212154620.GH56031@freepuppy.bellavista.cz> Mail-Followup-To: Paul Murphy , FreeBSD Questions References: <20021212075922.13985ff8.pnmurphy@cogeco.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021212075922.13985ff8.pnmurphy@cogeco.ca> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG please keep the line length below 75 characters. thank you. # pnmurphy@cogeco.ca / 2002-12-12 07:59:22 -0500: > I am having trouble understanding what is the difference between > "$variable" and "${variable}". if the variable name is really "variable", then none. > I have read sh(1) and understand than ${} is a "parameter" and can > contain more than just a variable, but browsing through /etc/rc I see > lots of "${variable}" (i.e. "case ${svc_val} in"). > > Is this just for readability or is there some functional difference? sh(1): The simplest form for parameter expansion is: ^^^^^^^^^^^^^^^^^^^ ${parameter} The value, if any, of parameter is substituted. The parameter name or symbol can be enclosed in braces, which are ^^^ optional except for positional parameters with more than one digit ^^^^^^^^ or when parameter is followed by a character that could be interpreted as part of the name. so yes, it's mostly a matter of style. -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message