zsh-users
 help / color / mirror / code / Atom feed
From: Geoff Wing <gcw@zsh.org>
To: Zsh-Users List <zsh-users@zsh.org>
Subject: Re: set variable to output and immediately lowercase it?
Date: Wed, 17 Oct 2012 11:31:06 +1100	[thread overview]
Message-ID: <20121017003106.GA7448@primenet.com.au> (raw)
In-Reply-To: <CADjGqHvY-2-geC3F+O7-72N=52m+Q6_0J92-vQxPiFh2ufYvdA@mail.gmail.com>

On Tuesday 2012-10-16 18:42 -0400, TJ Luoma output:
:Is there a (reasonably sane) way to combine these into one line:
:	FOO=$(echo HeLlo WoRlD)
:	FOO="${FOO:l}"
: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.

Try small `l' parameter modifier
	FOO=${$(echo HeLlo WoRlD):l}
or capital `L' parameter expansion flag
	FOO=${(L)$(echo HeLlo WoRlD)}

Regards,
Geoff


  parent reply	other threads:[~2012-10-17  0:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16 22:42 TJ Luoma
2012-10-16 23:05 ` Kurtis Rader
2012-10-17  0:31 ` Geoff Wing [this message]
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=20121017003106.GA7448@primenet.com.au \
    --to=gcw@zsh.org \
    --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).