Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Understanding why...



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



Messages sorted by: Reverse Date, Date, Thread, Author