From: Chris Johnson <cjohnson@cs.utk.edu>
To: zsh-users@sunsite.dk
Subject: Re: Multiline Anonymous Literal Strings
Date: Mon, 2 Oct 2006 08:42:01 -0400 [thread overview]
Message-ID: <20061002124201.GA28256@namib.cs.utk.edu> (raw)
In-Reply-To: <060928215246.ZM4576@torch.brasslantern.com>
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@cs.utk.edu
http://www.cs.utk.edu/~cjohnson
prev parent reply other threads:[~2006-10-02 12:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-28 17:51 Chris Johnson
2006-09-28 17:57 ` Michael Hernandez
2006-09-28 18:27 ` Chris Johnson
2006-09-28 18:26 ` Frank Terbeck
2006-09-29 4:52 ` Bart Schaefer
2006-10-02 12:42 ` Chris Johnson [this message]
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=20061002124201.GA28256@namib.cs.utk.edu \
--to=cjohnson@cs.utk.edu \
--cc=zsh-users@sunsite.dk \
/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).