From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1574 invoked by alias); 26 Mar 2017 19:24:46 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40901 Received: (qmail 325 invoked from network); 26 Mar 2017 19:24:46 -0000 X-Qmail-Scanner-Diagnostics: from mail.cs.uni-magdeburg.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(141.44.21.48):SA:0(-0.0/5.0):. Processed in 2.383416 secs); 26 Mar 2017 19:24:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: elkner@cs.uni-magdeburg.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at cs.uni-magdeburg.de does not designate permitted sender hosts) Date: Sun, 26 Mar 2017 21:18:28 +0200 From: Jens Elkner To: zsh-workers@zsh.org Subject: get keys of an associative array? Message-ID: <20170326191828.GA13089@trex.cs.ovgu.de> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Milter: milter4j - Mail Filter for Java 1.1.4 (b767) X-Milter: ClamAV 0.98.1-jel on mail - Status: Clean X-RcptTo: zsh-workers@zsh.org Hi, I've KSH_ARRAYS (beside KSH_GLOB KSH_TYPESET KSH_OPTION_PRINT) set, however, getting the key set of an array via ${!vname[@]} (as usually done within ksh or bash) does not work (bad substitution). Couldn't find anything else, except the @k flag, but this doesn't work as well, e.g. unset A; typeset -A A; A['a']=1; A['b']=2; A['c']=3 ; print "${(@k)A}" should print 'a b c' but prints '3'. Bug, feature? Hmmm, any hints? Thanx, jel. -- Otto-von-Guericke University http://www.cs.uni-magdeburg.de/ Department of Computer Science Geb. 29 R 027, Universitaetsplatz 2 39106 Magdeburg, Germany Tel: +49 391 67 52768