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

Re: Is there a way to get the “full” time zone currently in use?



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@xxxxxxxxx> 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
>


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