bug-coreutils
[Top][All Lists]
Advanced

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

bug#22568: "grep ... | tee file" drops the 'n' in its output


From: Eric Blake
Subject: bug#22568: "grep ... | tee file" drops the 'n' in its output
Date: Fri, 5 Feb 2016 15:05:24 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 02/05/2016 02:41 PM, oldefoxx wrote:
> Odd problem.  Seems to be partly tied to when IFS=\n is used for

You didn't provide enough context for us to see what you were actually
typing.  But if you really typed:

IFS=\n
....stuff....

then that's the same as if you had typed:

IFS=n

which tells the shell to treat 'n' (and only 'n') as the character to
use during word splitting.  And that's a rather unusual use of IFS.

Did you mean to type:

IFS=$'\n'

as a way to limit IFS to just newlines?  Compared to the usual default
IFS of $' \t\n'?

> handling read statements.  Can't find a way around it that works
> reliably, so forced to use
>     grep  ... > file; cat file

It's not obvious how grep, cat, or tee fit into the picture here.
Without seeing the full shell script you are running, it is very hard to
say what exactly went wrong for you, but in all likelihood, it is NOT a
bug in 'tee' nor in 'grep', but a case of the shell doing exactly what
you told it to.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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