From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8234 invoked from network); 15 Jun 2004 02:44:31 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 15 Jun 2004 02:44:31 -0000 Received: (qmail 14528 invoked from network); 15 Jun 2004 02:43:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Jun 2004 02:43:57 -0000 Received: (qmail 22791 invoked by alias); 15 Jun 2004 02:43:32 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7547 Received: (qmail 22781 invoked from network); 15 Jun 2004 02:43:32 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 15 Jun 2004 02:43:29 -0000 Received: (qmail 13779 invoked from network); 15 Jun 2004 02:43:29 -0000 Received: from goose.mail.pas.earthlink.net (207.217.120.18) by a.mx.sunsite.dk with SMTP; 15 Jun 2004 02:43:27 -0000 Received: from h-66-167-187-176.hstqtx02.dynamic.covad.net ([66.167.187.176] helo=amdxp.kalama.no-ip.org) by goose.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1Ba3v3-0003I6-00 for zsh-users@sunsite.dk; Mon, 14 Jun 2004 19:43:25 -0700 Received: from [10.0.1.2] (mothership.kalama.no-ip.org [10.0.1.2]) by amdxp.kalama.no-ip.org (Postfix) with ESMTP id 95BBB245 for ; Mon, 14 Jun 2004 21:43:25 -0500 (CDT) In-Reply-To: <20040614182400.GA6105@quark.hightek.org> References: <26243486-BDAE-11D8-BDC7-000A95D2C79E@kalama.no-ip.org> <20040614182400.GA6105@quark.hightek.org> Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Reply-To: zsh-users@sunsite.dk From: lists Subject: Re: typesetting parameters Date: Mon, 14 Jun 2004 21:43:35 -0500 To: zsh-users@sunsite.dk X-Mailer: Apple Mail (2.618) X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 What a friendly and helpful list this is. Thanks Vincent and Bart! On Jun 14, 2004, at 1:24 PM, Vincent Stemen wrote: > On Sun, Jun 13, 2004 at 09:58:57PM -0700, Bart Schaefer wrote: >> On Sun, 13 Jun 2004, lists wrote: >> >>> I'm having difficulty understanding why one would define a parameter >>> with typeset before using it. >> >> One probably wouldn't, when interactively typing commands, unless one >> wanted to use the special attributes such as padding, alignment, other >> integer bases, or floating-point precision. >> >> The primary time/place and reason to use typeset is when defining >> shell >> functions, to create variables that are local to the function scope. >> When >> you use "local" that's really an alias for typeset. > > Not only that, even outside of functions, some expressions such as > > variable+=$value > > will not always behave as intended if the variable is not typeset. If > it is typeset as an array for example, you can depend on it appending > "$value" to the list. Otherwise it might try to add it as an integer > or append it as a string, depending on it's value. > > Regards, > Vincent > > -- > Vincent Stemen > Avoid the VeriSign/Network Solutions domain registration trap! > Read how Network Solutions (NSI) was involved in stealing our domain > name. > http://www.InetAddresses.net >