Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Multiline Anonymous Literal Strings
- X-seq: zsh-users 10777
- From: Chris Johnson <cjohnson@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Multiline Anonymous Literal Strings
- Date: Mon, 2 Oct 2006 08:42:01 -0400
- In-reply-to: <060928215246.ZM4576@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20060928175133.GA26895@xxxxxxxxxxxxxxxxx> <060928215246.ZM4576@xxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer sent me the following 1.1K:
> } Anyone know of a way to compose a long literal string without doing
> } something like this?
>
> The following requires "setopt multios" (which is the default, but a
> few people turn it off):
>
> alias mycommand=${(j: :)"${(f)$(<<<'print this is one string'
> # This is a comment, but you cannot use unbalanced quotes in it
> <<<'this is a more " " spacey " " string'
> <<<'this is a third string')}"}
Thanks. I was trying to develop something like this with the (j::), but
didn't know how to get the anonymous array.
> } In Perl and other languages, concatenation operators like ., &, and +
> } are available.
>
> And your point is?
>
> The syntax of the shell language (which is only implemented by zsh, not
> defined by it) precludes the use of infix operators.
The ability to set literal operands apart with whitespace is also
precluded by simple juxtaposition-based concatenation.
The thought just occurred to me that I could write a function which
concatenates its arguments. I'll give that a try.
--
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author