From owner-freebsd-questions Thu Dec 12 7:43:40 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 DD28D37B401 for ; Thu, 12 Dec 2002 07:43:39 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id E25EC43ED8 for ; Thu, 12 Dec 2002 07:43:38 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.6) id gBCFhZxm071983; Thu, 12 Dec 2002 09:43:35 -0600 (CST) (envelope-from dan) Date: Thu, 12 Dec 2002 09:43:34 -0600 From: Dan Nelson To: Paul Murphy Cc: FreeBSD Questions Subject: Re: Shell variables Message-ID: <20021212154334.GC7232@dan.emsphone.com> 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> X-OS: FreeBSD 5.0-RC X-message-flag: Outlook Error 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 In the last episode (Dec 12), Paul Murphy said: > I am having trouble understanding what is the difference between > "$variable" and "${variable}". > > 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? Mainly readability, but sometimes you need the {}'s to delimit the variable name: compare echo texttext${variablehere}texttext vs. echo texttext$variableheretexttext -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message