zsh-users
 help / color / mirror / code / Atom feed
From: Clint Priest <cpriest@zsh-users.rxv.me>
To: zsh-users@zsh.org
Subject: Understanding why...
Date: Mon, 7 Aug 2017 18:46:29 -0500	[thread overview]
Message-ID: <20b0b8aa-6db5-9b61-961c-b9a7ba10f34d@zsh-users.rxv.me> (raw)

[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]

Hello,

I'm new to the list and to ZSH, long time bash user though.

I was writing a function which would convert the LS_COLORS entry to an 
associative array.

I have solved the issue but I'd like to understand why it was 
necessary.  I'll take an answer from someone here, but what I'd really 
like to find out is if there is *some sort of 'set -x' functionality 
that would give me verbose information *about what is going on.

So, given:

LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:

This gave me the results I wanted:

typeset-A LSC=(${(@s/=/)${(@s/:/)${LS_COLORS%:}}})


What it needed was the two @ flags.  I'd like to understand just what is 
going on in each step of the expansion that required those two flags.

Thanks for any help!

-Clint

-- 

-Clint


             reply	other threads:[~2017-08-07 23:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07 23:46 Clint Priest [this message]
2017-08-08  0:36 ` Bart Schaefer
2017-08-08  1:26   ` Clint Priest
2017-08-08  5:25     ` Bart Schaefer

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=20b0b8aa-6db5-9b61-961c-b9a7ba10f34d@zsh-users.rxv.me \
    --to=cpriest@zsh-users.rxv.me \
    --cc=zsh-users@zsh.org \
    /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).