On Mon, Sep 06, 2021 at 07:38:03AM +, Budi wrote:
> How come tail coreutil cannot work as its input is from tee
>
> $ echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tail -1
> 1
>
> But :
>
> $ echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tee >(head -1) |tail -1
> 9
>
> Please help explain
It would be better if yo
On Mon, Sep 06, 2021 at 07:38:03AM +, Budi wrote:
> How come tail coreutil cannot work as its input is from tee
>
> $ echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tail -1
> 1
>
> But :
>
> $ echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tee >(head -1) |tail -1
> 9
>
> Please help explain
I don't see how this is
Because your last pipe will pipe BOTH output of `echo` AND `head` with
delay due to fork, head output will comme after. try this:
echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tee >(head -1 >&2) |tail -1
or
echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tee >(head -1 >&2) >(tail -1 >&2) >/dev/null
...
On Mon, Sep
On Mon, Sep 06, 2021 at 07:38:03AM +, Budi wrote:
> How come tail coreutil cannot work as its input is from tee
>
> $ echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tail -1
> 1
>
> But :
>
> $ echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tee >(head -1) |tail -1
> 9
>
> Please help explain
Not a bug.
If you leave
09:38
Subject: Why tail coreutil cannot work as its input is from tee
To:
How come tail coreutil cannot work as its input is from tee
$ echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tail -1
1
But :
$ echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tee >(head -1) |tail -1
9
Please help explain
How come tail coreutil cannot work as its input is from tee
$ echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tail -1
1
But :
$ echo -e '9\n4\n3\n2\n8\n7\n3\n1' |tee >(head -1) |tail -1
9
Please help explain