Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Understanding why...
- X-seq: zsh-users 22797
- From: Clint Priest <cpriest@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Understanding why...
- Date: Mon, 7 Aug 2017 18:46:29 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=++g9QCthVbOD55jIN3csZd1Mk5Gyv2X4YzhqDHofv Y4=; b=kXobYh1gg6MOh7N/qr8LDr+clASv7czsICPL0wl/kJsPmMb6czJp7oacl TslUP5gtpzlOPS0zgeVwxUCWS8PXvzSIwXr0crM1hhjGWjM7a7zLt4K7bkow1YNg xixhsbO0hrSp3qZaG91OWTxPvOih9fdG4w2fUJzjkeuj0mO6vQ1i1OeEGPLxQ/LW lOv+dnZbAWuN/aS3HTt4CG3n1oRo66KYf8K9JH8DBq+TXurq5uuarriR8jljLvAC 3hJDa83eQx/gCFMYsF6ajrhUdWxy/mG3ZtJrUGtnGXStliPVvvyY2MT2FoivzC3r QRyl+PczjZqDNldtrmRE9ABOpwfeA==
- 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
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