Re: [PATCH 6/6] Add a simple test script, embed expected results into test files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/9/07, Damien Lespiau <damien.lespiau@xxxxxxxxx> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux