From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24817 invoked from network); 14 Jul 2008 21:34:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 Jul 2008 21:34:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 48709 invoked from network); 14 Jul 2008 21:34:45 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Jul 2008 21:34:45 -0000 Received: (qmail 5391 invoked by alias); 14 Jul 2008 21:34:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25280 Received: (qmail 5373 invoked from network); 14 Jul 2008 21:34:40 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 14 Jul 2008 21:34:40 -0000 Received: from asmtpout012.mac.com (asmtpout012.mac.com [17.148.16.87]) by bifrost.dotsrc.org (Postfix) with ESMTP id 62D5A80525AB for ; Mon, 14 Jul 2008 23:34:25 +0200 (CEST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from zinn-desktop1.us.randomhouse.com (pool-71-191-51-76.washdc.fios.verizon.net [71.191.51.76]) by asmtp012.mac.com (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTPA id <0K400098LMKT4V50@asmtp012.mac.com> for zsh-workers@sunsite.dk; Mon, 14 Jul 2008 14:34:06 -0700 (PDT) Sender: jev@mac.com Message-id: <398A2623-A473-4DFA-89C8-91716D1405AB@mac.com> From: Jaime Vargas To: Zsh hackers list Subject: Idiom Date: Mon, 14 Jul 2008 17:34:05 -0400 X-Mailer: Apple Mail (2.928.1) X-Virus-Scanned: ClamAV 0.92.1/7709/Mon Jul 14 18:16:52 2008 on bifrost X-Virus-Status: Clean Is there a better way to setup the ${mask_octects} array? Without the back-ticks the expression constructs an array of one element. -- Jaime #!/bin/zsh declare -A cidr_to_mask cidr_to_mask=( 16 255.255.0.0 17 255.255.128.0 18 255.255.192.0 19 255.255.224.0 20 255.255.240.0 21 255.255.248.0 22 255.255.252.0 23 255.255.254.0 24 255.255.255.0 25 255.255.255.128 26 255.255.255.192 27 255.255.255.224 28 255.255.255.240 29 255.255.255.248 30 255.255.255.252 31 255.255.255.254 32 255.255.255.255 ) set -A mask_octects `echo ${cidr_to_mask[22]//./ }`