[prev in list] [next in list] [prev in thread] [next in thread] 

List:       coreutils-bug
Subject:    bug#22568: "grep ... | tee file" drops the 'n' in its output
From:       Eric Blake <eblake () redhat ! com>
Date:       2016-02-05 22:05:24
Message-ID: 56B51CA4.1080101 () redhat ! com
[Download RAW message or body]


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


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic