zsh-users
 help / color / mirror / code / Atom feed
* Understanding why...
@ 2017-08-07 23:46 Clint Priest
  2017-08-08  0:36 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Clint Priest @ 2017-08-07 23:46 UTC (permalink / raw)
  To: zsh-users

[-- 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-08  5:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 23:46 Understanding why Clint Priest
2017-08-08  0:36 ` Bart Schaefer
2017-08-08  1:26   ` Clint Priest
2017-08-08  5:25     ` Bart Schaefer

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).