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

Re: set variable to output and immediately lowercase it?



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



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