Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: set variable to output and immediately lowercase it?
- X-seq: zsh-users 17326
- From: Kurtis Rader <krader@xxxxxxxxxxxxx>
- To: TJ Luoma <luomat@xxxxxxxxx>
- Subject: Re: set variable to output and immediately lowercase it?
- Date: Tue, 16 Oct 2012 16:05:19 -0700
- Cc: Zsh-Users List <zsh-users@xxxxxxx>
- In-reply-to: <CADjGqHvY-2-geC3F+O7-72N=52m+Q6_0J92-vQxPiFh2ufYvdA@mail.gmail.com>
- 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
- References: <CADjGqHvY-2-geC3F+O7-72N=52m+Q6_0J92-vQxPiFh2ufYvdA@mail.gmail.com>
typeset -l FOO="$(echo HeLlo WoRlD)"
or more typically
typeset -l FOO
FOO=$(echo HeLlo WoRlD)
On Tue, Oct 16, 2012 at 3:42 PM, TJ Luoma <luomat@xxxxxxxxx> wrote:
> 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
>
--
Kurtis Rader
Caretake of the exceptional canines Junior and Chino
Messages sorted by:
Reverse Date,
Date,
Thread,
Author