Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 2002 09:43:34 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Paul Murphy <pnmurphy@cogeco.ca>
Cc:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Shell variables
Message-ID:  <20021212154334.GC7232@dan.emsphone.com>
In-Reply-To: <20021212075922.13985ff8.pnmurphy@cogeco.ca>
References:  <20021212075922.13985ff8.pnmurphy@cogeco.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021212154334.GC7232>