From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7497 invoked from network); 2 Oct 2006 12:42:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Oct 2006 12:42:24 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 87725 invoked from network); 2 Oct 2006 12:42:16 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Oct 2006 12:42:16 -0000 Received: (qmail 10147 invoked by alias); 2 Oct 2006 12:42:08 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10777 Received: (qmail 10137 invoked from network); 2 Oct 2006 12:42:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Oct 2006 12:42:08 -0000 Received: (qmail 86635 invoked from network); 2 Oct 2006 12:42:07 -0000 Received: from bes.cs.utk.edu (160.36.56.220) by a.mx.sunsite.dk with SMTP; 2 Oct 2006 12:42:06 -0000 Received: from localhost (localhost [127.0.0.1]) by bes.cs.utk.edu (Postfix) with ESMTP id 81888FCDC for ; Mon, 2 Oct 2006 08:41:49 -0400 (EDT) X-Virus-Scanned: by amavisd-new with ClamAV and SpamAssasin at cs.utk.edu Received: from bes.cs.utk.edu ([127.0.0.1]) by localhost (bes.cs.utk.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P7t7KddSmdYS for ; Mon, 2 Oct 2006 08:41:46 -0400 (EDT) Received: from namib.cs.utk.edu (namib.cs.utk.edu [160.36.59.92]) by bes.cs.utk.edu (Postfix) with ESMTP id 8A9D2FCC1 for ; Mon, 2 Oct 2006 08:41:46 -0400 (EDT) Received: by namib.cs.utk.edu (Postfix, from userid 10605) id 0433436F14; Mon, 2 Oct 2006 08:42:01 -0400 (EDT) Date: Mon, 2 Oct 2006 08:42:01 -0400 From: Chris Johnson To: zsh-users@sunsite.dk Subject: Re: Multiline Anonymous Literal Strings Message-ID: <20061002124201.GA28256@namib.cs.utk.edu> References: <20060928175133.GA26895@cetus5.cs.utk.edu> <060928215246.ZM4576@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <060928215246.ZM4576@torch.brasslantern.com> X-From-Chris: Yes User-Agent: Mutt/1.5.9i 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