bug-diffutils
[Top][All Lists]
Advanced

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

Re: [bug-diffutils] BUG comparing with stdin


From: Paul Eggert
Subject: Re: [bug-diffutils] BUG comparing with stdin
Date: Wed, 03 Aug 2011 15:34:35 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Thunderbird/3.1.11

On 08/03/11 10:39, Luís Gomes wrote:
> $ echo -n hello | diff <(echo -n hello) -
> 1d0
> < hello
> \ No newline at end of file

Thanks for the bug report.

I can't reproduce that in my environment (Fedora 14 x86-64):
I am using GNU diff 3.0 and the system-supplied Bash
(GNU bash, version 4.1.7(1)-release (x86_64-redhat-linux-gnu)).

What happens if you run the following commands?

echo -n hello | cat <(echo -n hello) - <(echo -n hello)

I get "hellohellohello", with no trailing newline.

Also, if you run the following command, what is the output and
what gets put into "strace.out"?

strace -f -o strace.out bash -c 'echo -n hello | diff <(echo -n hello) -'

In my environment, the above command outputs nothing, and the
crucial part of strace.out looks like this:

8395  stat("/dev/fd/63", {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
8395  fstat(0, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
8395  open("/dev/fd/63", O_RDONLY)      = 3
8395  read(3, "hello", 4096)            = 5
8395  read(3, "", 4091)                 = 0
8395  read(0, "hello", 4096)            = 5
8395  read(0, "", 4091)                 = 0
8395  close(3)                          = 0
8395  close(0)                          = 0
8395  close(1)                          = 0
8395  exit_group(0)                     = ?

which is the right behavior: read both inputs and then output nothing.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]