Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: convert number
- X-seq: zsh-users 15071
- From: tartifola@xxxxxxxxx
- To: zsh-users@xxxxxxx
- Subject: Re: convert number
- Date: Thu, 20 May 2010 16:56:14 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:reply-to:organization:x-mailer :mime-version:content-type:content-transfer-encoding; bh=6i4UOeYpD+hw66AfwjAUCgkQPbrvAprwvX6urZW0B7Q=; b=KBgJafWytNNyGiZzFOahBxt2a9JzhuVzoNUkMdHyNSFH5Kugy/hrA7nlMsOh8h1w4L j4izW6iGp9IzkxpZ5E6A6PUrKHSSpx46s73jw8VjtOuwqECaSnmMXxQOcc8zwmppVwbV E347wlAyssXsP/WpYbEutYlaHwg4AFjNIQ7rk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:reply-to :organization:x-mailer:mime-version:content-type :content-transfer-encoding; b=Z5oQ91n1t73ofOKIpGUAOJguf8/+YehtpvAJRB1j2NeDxDLOqH/ta7/Lo9Yc2UvqtO OdwhXIkJn9fgfgcI/IMf7Ggy7XYqIjw53oSSc+DosS49Lt34vC/GL3EGeldhLkiGQJgV OUZiKmUALl6gXBXdlkTQkzHimfCW2MYS1/CNA=
- In-reply-to: <AANLkTinJI3hwg_AKfZrozMeraF1d2zXDIstQMuXCD-Ih@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Tartifola Inc.
- References: <20100519191103.b712607f.tartifola@xxxxxxxxx> <AANLkTikMDn2tqfIdv1-UE0ZtJrGY7cgMpUHREwor2a6_@xxxxxxxxxxxxxx> <AANLkTinJI3hwg_AKfZrozMeraF1d2zXDIstQMuXCD-Ih@xxxxxxxxxxxxxx>
- Reply-to: tartifola@xxxxxxxxx
On Thu, 20 May 2010 07:51:09 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Wed, May 19, 2010 at 11:39 AM, Christian Walther <cptsalek@xxxxxxxxx> wrote:
> >
> > if there is no mathematical formula for the "conversion table"
> > available, I would put this table in a hash, e.g. something like:
> >
> > typeset -A convtable
> > convtable[151]=2
> > convtable[152]=2
> >
> > etc...
>
> You can shortcut this:
>
> typeset -A convtable
> convtable=(151 2 152 2 153 2 158 4 159 3 160 2 171 4 172 1 173 4)
>
> Note that you must have an even number of elements in the assignment
> list, because they are taken as key value key value etc. The
> assignment will fail otherwise.
Thanks, works perfectly.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author