zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: Fun with zsh (Re: Associative array ordering (Re: Example function))
Date: Tue, 2 Feb 1999 03:31:47 -0800	[thread overview]
Message-ID: <990202033147.ZM3545@candle.brasslantern.com> (raw)
In-Reply-To: <199902020801.JAA08446@beta.informatik.hu-berlin.de>

On Feb 2,  9:01am, Sven Wischnowsky wrote:
} Subject: Re: Associative array ordering and selective unset (Re: Example f
}
} Bart Schaefer wrote:
} 
} > Now change the assignment a little:
} > 
} >         map=('*.(gz|Z)' ': 1; zcat
} >              '*.bz2' ': 2; bzip2 -dc'
} >              '*.bz' ': 3; bzip -dc'
} >              '*' ': 4; <')
} 
} Hmm, I like this. For bigger arrays one would have to use `01' and so
} on, but this should be acceptible.

Somewhat off-topic, but how about this trick?  (Where map is a plain array
this time.)

    map=(
    	'(*.(gz|Z))	zcat' 
	'(*.bz2)	bzip2 -dc'
	'(*.bz)		bzip -dc'
	'(*)		<'
	)
    eval 'for i do case $i in' ${(j( $i;; ))map} '$i;; esac done'

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~1999-02-02 11:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-02  8:01 Associative array ordering and selective unset (Re: Example function) Sven Wischnowsky
1999-02-02 11:31 ` Bart Schaefer [this message]
     [not found] <jarausch-990202124256.A09694@numa1>
1999-02-02 11:59 ` Fun with zsh (Re: Associative array ordering (Re: Example function)) Bart Schaefer
1999-02-02 12:10   ` Bart Schaefer
1999-02-02 12:26 Sven Wischnowsky
1999-02-02 16:54 ` Bart Schaefer
1999-02-02 17:19 Sven Wischnowsky
1999-02-02 17:48 ` Bart Schaefer
1999-02-03 10:41 Sven Wischnowsky
1999-02-03 15:00 Sven Wischnowsky
1999-02-03 17:38 ` Bart Schaefer
1999-02-04  8:06 Sven Wischnowsky
1999-02-04 16:11 ` Bart Schaefer
1999-02-05  7:45 Sven Wischnowsky
1999-02-05  8:58 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=990202033147.ZM3545@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).