From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26561 invoked from network); 2 Feb 2007 09:04:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Feb 2007 09:04:14 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 67006 invoked from network); 2 Feb 2007 09:04:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Feb 2007 09:04:07 -0000 Received: (qmail 29497 invoked by alias); 2 Feb 2007 09:03:59 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11174 Received: (qmail 29487 invoked from network); 2 Feb 2007 09:03:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Feb 2007 09:03:58 -0000 Received: (qmail 65822 invoked from network); 2 Feb 2007 09:03:58 -0000 Received: from mailhost.u-strasbg.fr (130.79.200.151) by a.mx.sunsite.dk with SMTP; 2 Feb 2007 09:03:52 -0000 Received: from [130.79.188.217] (sys-univ-x.u-strasbg.fr [130.79.188.217]) by mailhost.u-strasbg.fr (8.13.8/jtpda-5.5pre1) with ESMTP id l1293o6r003871 for ; Fri, 2 Feb 2007 10:03:50 +0100 (CET) Message-ID: <45C2FE72.7040303@ulpmm.u-strasbg.fr> Date: Fri, 02 Feb 2007 10:03:46 +0100 From: Marc Chantreux User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: zsh-users Subject: keep empty lines at the end of files? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (mailhost.u-strasbg.fr [130.79.200.151]); Fri, 02 Feb 2007 10:03:50 +0100 (CET) X-Virus-Scanned: ClamAV 0.88.7/2514/Thu Feb 1 22:50:10 2007 on mr1.u-strasbg.fr X-Virus-Status: Clean hi all, I have some files with very important empty lines at the end of them. I try to grab the file content but i don't find easy syntax to honor those lines. Is the a clean and short way to *not* trim the file ? Regards mc Exemple: Script : cat -n ldap_user_passwd print '# read all file does not work' read -rd$'\0' content < ldap_user_passwd print "[[$content]]" print print '# < does not work' print "[[$( < ldap_user_passwd )]]" print '# read each line works ... but i hope there is shorter way' content=; < ldap_user_passwd while { read line } { content+=$line$'\n' } print "[[$content]]" OUPUT : 1 2 dn: ¨-$entry[dn]¨ 3 changetype: modify 4 replace: userPassword 5 userPassword: ¨-$( pwd/Next )¨ 6 7 # read all file does not work [[dn: ¨-$entry[dn]¨ changetype: modify replace: userPassword userPassword: ¨-$( pwd/Next )¨]] # < does not work [[ dn: ¨-$entry[dn]¨ changetype: modify replace: userPassword userPassword: ¨-$( pwd/Next )¨]] # read each line works ... but i hope there is shorter way [[ dn: ¨-$entry[dn]¨ changetype: modify replace: userPassword userPassword: ¨-$( pwd/Next )¨ ]]