From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15419 invoked from network); 1 Feb 2003 15:48:37 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 1 Feb 2003 15:48:37 -0000 Received: (qmail 28019 invoked by alias); 1 Feb 2003 15:48:04 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5857 Received: (qmail 28010 invoked from network); 1 Feb 2003 15:48:04 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 1 Feb 2003 15:48:04 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [143.90.131.181] by sunsite.dk (MessageWall 1.0.8) with SMTP; 1 Feb 2003 15:48:3 -0000 Received: from rabi ([211.121.228.201]) by t-mta3.odn.ne.jp with SMTP id <20030201154804372.JSOZ.895.t-mta3.odn.ne.jp@mta3.odn.ne.jp>; Sun, 2 Feb 2003 00:48:04 +0900 From: "Clifford Caoile" To: "William Park" Cc: Subject: RE: (feature request) Shell script within shell script Date: Sun, 2 Feb 2003 00:48:01 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <20030201073655.GA3893@node1.opengeometry.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal William Park: I am not an expert, but I was exploring here documents in bash and zsh just this last week. Let me see if I get this right: In zsh-4.0.x, you can use "here documents" or "here-strings". A here document has this syntax (note there is no double quotations necessary): >> /etc/hosts <> $tmpcmdfile ... chmod 700 $tmpcmdfile $tmpcmdfile rm $tmpcmdfile Do you like typing? ;-) This example actually led me to exploring here documents. Specifically with your example, I am unable to ascertain what you want to do. Do you want to execute that here document on the line where you declare it? What does that "herefile" mean? Is that syntactic sugar meaning "foreign language eval?" In any event, I do not know how to do that, and I don't think that's a zsh-4.0.x capability. Can a real expert answer please? ;-) HTH ,-~-. < ^ ; ~, Clifford Escobar CAOILE (aka "Piyo-kun") (_ _, J~~> _.___...:.__..__.: __.:_. .:_.__::_..:._::._... _____ p(^_^)q | -----Original Message----- | From: William Park [mailto:opengeometry@yahoo.ca] | Sent: Saturday, February 01, 2003 16:37 | To: zsh-users@sunsite.dk | Subject: Re: (feature request) Shell script within shell script | | | Dear Zsh expert, | | When writing a shell script, quite often, I have to write bunch of | separate Awk/Python/Perl/etc scripts that are more than few lines. I | tend to lose track of which script does what, and get bitten over two | levels of quotes. | | Essentially, I wish I could do something like | | herefile test1 << "EOF" | #! /usr/bin/gawk -f | ... | ... | EOF | | and | | herefile test2 << "EOF" | #! /usr/bin/python | ... | ... | EOF | | so that invocation and usage of 'test1' and 'test2' will be the same as | if they were separate real files. | | Can Zsh do this now? If not, does Zsh have standard mechanism to | provide this kind of extensions? | | -- | William Park, Open Geometry Consulting, | Linux solution for data management and processing.