From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Anderson Lizardo" Subject: Re: [PATCH 6/6] Add a simple test script, embed expected results into test files Date: Tue, 10 Jul 2007 20:48:12 -0400 Message-ID: <5b5833aa0707101748x2a8cbc10ocaf44e92d19802fc@mail.gmail.com> References: <20070628053954.30704.66440.stgit@dv.roinet.com> <46836129.7050407@freedesktop.org> <1183066733.2621.127.camel@josh-work.beaverton.ibm.com> <1183076949.2621.196.camel@josh-work.beaverton.ibm.com> <46915C9E.503@freedesktop.org> <46919A4C.3090602@freedesktop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from wa-out-1112.google.com ([209.85.146.182]:24599 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752831AbXGKAsN (ORCPT ); Tue, 10 Jul 2007 20:48:13 -0400 Received: by wa-out-1112.google.com with SMTP id v27so2097407wah for ; Tue, 10 Jul 2007 17:48:12 -0700 (PDT) In-Reply-To: Content-Disposition: inline Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Damien Lespiau Cc: Josh Triplett , linux-sparse@vger.kernel.org On 7/9/07, Damien Lespiau wrote: > However I bumped into another issue: > $ hexdump -C bar > 00000000 0a 0a 78 78 78 0a 0a 0a |..xxx...| > $ foo=`cat bar` > $ echo "$foo" | hexdump -C > 00000000 0a 0a 78 78 78 0a |..xxx.| > > it eats the last new lines but one and not the first '\n's ! > I still have to sort this out... Actually, it eats both newlines... The trailing newline that still appears is from "echo" command, which appends a newline by default. Try: echo -n "$foo" | hexdump -C instead. Anyway, this is from "man bash": "Command Substitution [...] Bash performs the expansion by executing command and replacing the command substitution with the standard output of the command, with any trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting." So I suppose this is an expected behaviour. Regards, -- Anderson Lizardo