zsh-users
 help / color / mirror / code / Atom feed
From: TJ Luoma <luomat@gmail.com>
To: Zsh-Users List <zsh-users@zsh.org>
Subject: Re: Is there a way to get the “full” time zone currently in use?
Date: Tue, 31 Jul 2018 09:54:18 -0400	[thread overview]
Message-ID: <CADjGqHuwrAnYjDGN8R97NRP39MCFVqcTxq7hURO0So_5_Cwkkw@mail.gmail.com> (raw)
In-Reply-To: <20180729153250.GA63277@CptOrmolo.darkstar>

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

Wow. That’s excellent. Another Zsh feature that I clearly need to learn
more about, because I use ’sed’ for that sort of thing _all the time_.

Thanks!

TjL



--
TJ Luoma
TJ @ MacStories <http://www.macstories.net/author/tjluoma/>
Personal Website: luo.ma <http://luo.ma/> (aka RhymesWithDiploma.com
<http://rhymeswithdiploma.com/>)
Twitter: @tjluoma <http://twitter.com/tjluoma>



On Sun, Jul 29, 2018 at 11:32 AM Matthew Martin <phy1729@gmail.com> wrote:

> On Sun, Jul 29, 2018 at 08:56:21AM -0400, TJ Luoma wrote:
> > That works, and I haven’t found anything else that does. This:
> >
> > readlink /etc/localtime | sed ’s#.*/zoneinfo/##g'
>
> There's no need for external commands here.
>
> a=(/etc/localtime(:A))  # Resolve the symlink
> print ${a##*/zoneinfo/} # Remove text preceding and including /zoneinfo/
>
> - Matthew Martin
>

      reply	other threads:[~2018-07-31 13:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 16:12 TJ Luoma
2018-07-27 23:09 ` Linus Arver
2018-07-29 12:56   ` TJ Luoma
2018-07-29 15:32     ` Matthew Martin
2018-07-31 13:54       ` TJ Luoma [this message]

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=CADjGqHuwrAnYjDGN8R97NRP39MCFVqcTxq7hURO0So_5_Cwkkw@mail.gmail.com \
    --to=luomat@gmail.com \
    --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).