From owner-freebsd-questions@FreeBSD.ORG Fri Jan 7 04:39:41 2005 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 9377316A4CE for ; Fri, 7 Jan 2005 04:39:41 +0000 (GMT) Received: from whisk.dreamhost.com (whisk.dreamhost.com [205.196.208.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7442343D48 for ; Fri, 7 Jan 2005 04:39:41 +0000 (GMT) (envelope-from lists@tntluoma.com) Received: from [192.168.2.102] (user-33qt99b.dialup.mindspring.com [199.174.165.43]) by whisk.dreamhost.com (Postfix) with ESMTP id 8EB20175108; Thu, 6 Jan 2005 20:39:39 -0800 (PST) In-Reply-To: <41DE096C.3060903@vilot.com> References: <06DDB71C-5DB4-11D9-B56F-000D9333E43C@secure-computing.net> <8B357427-5DB7-11D9-89A5-000D93AD26C8@tntluoma.com> <7B531D49-6041-11D9-8A15-000D9333E43C@secure-computing.net> <41DDE5C5.2050402@vilot.com> <1F964093-6051-11D9-90DC-000D9333E43C@secure-computing.net> <41DE096C.3060903@vilot.com> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <248793A4-6066-11D9-8BE8-000D93AD26C8@tntluoma.com> Content-Transfer-Encoding: 7bit From: Timothy Luoma Date: Thu, 6 Jan 2005 23:39:39 -0500 To: Eric F Crist X-Mailer: Apple Mail (2.619) cc: FreeBSD-Questions Questions Subject: Re: my lame attempt at a shell script... 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: Fri, 07 Jan 2005 04:39:41 -0000 On Jan 6, 2005, at 11:00 PM, Tom Vilot wrote: > Eric F Crist wrote: > >> What is the point of the { } around some variables? > > It's not strictly necessary, except in some cases. i.e: > > m=34 > echo $m > You don't need it there. > But you would want it here: > f=/var/filename > fname=${f//name/name2} > > It's when you need to differentiate the variable name from operations > around it ... for want of a better explanation a good explanation. When I'm being particularly fussy about a script, I'll use echo "${m}" just in case $m has some unexpected characters in it such as a space ! $ * etc which can really screw things up. TjL