From: TJ Luoma <luomat@gmail.com>
To: Zsh-Users List <zsh-users@zsh.org>
Subject: set variable to output and immediately lowercase it?
Date: Tue, 16 Oct 2012 18:42:07 -0400 [thread overview]
Message-ID: <CADjGqHvY-2-geC3F+O7-72N=52m+Q6_0J92-vQxPiFh2ufYvdA@mail.gmail.com> (raw)
Is there a (reasonably sane) way to combine these into one line:
FOO=$(echo HeLlo WoRlD)
FOO="${FOO:l}"
I mean, I know I could do this:
FOO=$(echo HeLlo WoRlD | tr '[:upper:]' '[:lower:]')
but I mean is it possible to do this all in zsh.
I tried
FOO=$(echo HeLlo WoRlD):l
and
FOO=($(echo HeLlo WoRlD):l)
but they don't work, it just adds ":l" to the end of the variable.
TjL
next reply other threads:[~2012-10-16 22:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 22:42 TJ Luoma [this message]
2012-10-16 23:05 ` Kurtis Rader
2012-10-17 0:31 ` Geoff Wing
2012-10-17 2:28 ` TJ Luoma
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='CADjGqHvY-2-geC3F+O7-72N=52m+Q6_0J92-vQxPiFh2ufYvdA@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).