From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11231 invoked from network); 17 Feb 2005 09:12:02 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Feb 2005 09:12:02 -0000 Received: (qmail 5139 invoked from network); 17 Feb 2005 09:11:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Feb 2005 09:11:56 -0000 Received: (qmail 22789 invoked by alias); 17 Feb 2005 09:11:39 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8515 Received: (qmail 22779 invoked from network); 17 Feb 2005 09:11:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Feb 2005 09:11:39 -0000 Received: (qmail 3993 invoked from network); 17 Feb 2005 09:11:39 -0000 Received: from ns9.hostinglmi.net (213.194.149.146) by a.mx.sunsite.dk with SMTP; 17 Feb 2005 09:11:34 -0000 Received: from 212.red-80-35-44.pooles.rima-tde.net ([80.35.44.212]:32772 helo=localhost) by ns9.hostinglmi.net with esmtpa (Exim 4.44) id 1D1hh8-0004Lf-Qd for zsh-users@sunsite.dk; Thu, 17 Feb 2005 10:11:35 +0100 Date: Thu, 17 Feb 2005 10:12:56 +0100 From: DervishD To: Zsh Users Subject: Adding arbitrary data at the end of a script Message-ID: <20050217091256.GA941@DervishD> Mail-Followup-To: Zsh Users Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.2.1i Organization: DervishD X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ns9.hostinglmi.net X-AntiAbuse: Original Domain - sunsite.dk X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - dervishd.net X-Source: X-Source-Args: X-Source-Dir: X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Hi all :) I'm doing a self-contained script that needs some data to work. This data is going to be added at the end of script (after the 'exit 0' command that terminates the script), but zsh reads *and tries to expand* the entire bunch of data. I haven't found in SUS anything that forbids or allows this behaviour, and I'm confused. The script is functionally like this: #!/bin/zsh true exit 0 I've tried this, too: #!/bin/zsh true exit 0 cat << DATA.EOF > /dev/null DATA.EOF Obviously, I can quote, by hand, all things that makes the shell barf (not only Zsh, Bash suffer from this too), but I would like to avoid it because it will be very time consuming and error prone. In fact, the 'bunch of data' is no more than a shell script skeleton that will be processed through sed. The main script uses something like this: cat 0 | sed... to process itself and the bunch of data and generate another script. If I cannot avoid the data to be read by the shell, how can I avoid expansion portably? The script must be self-contained, and the data must go inside of it. I've thought of a solution but it's not very good for me and I would like to avoid it: ASCII armoring the 'data' (removing the shell metachars in the process) and dearmoring it on the fly while processing through sed... Thanks in advance :) Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 http://www.dervishd.net & http://www.pleyades.net/ It's my PC and I'll cry if I want to...