[gpfsug-discuss] Odd behavior with cat followed by grep.

John Hanks griznog at gmail.com
Wed Feb 14 05:32:39 GMT 2018


Hi,

We have a GPFS filesystem mounted on CentOS 7.4 as type gpfs, pretty
straightforward run of the mill stuff. But are seeing this odd behavior. If
I do this in a shell script, given a file called "a"

cat a a a a a a a a a a > /path/to/gpfs/mount/test
grep ATAG /path/to/gpfs/mount/test | wc -l
sleep 4
grep ATAG /path/to/gpfs/mount/test | wc -l

The first grep | wc -l returns 1, because grep outputs  "Binary
file /path/to/gpfs/mount/test matches"

The second grep | wc -l returns the correct count of ATAG in the file.

Why does it take 4 seconds (3 isn't enough) for that file to be properly
recognized as a text file and/or why is it seen as a binary file in the
first place since a is a plain text file?

Note that I have the same filesystem mounted via NFS and over an NFS mount
it works as expected.

Any illumination is appreciated,

jbh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gpfsug.org/pipermail/gpfsug-discuss_gpfsug.org/attachments/20180213/6421805c/attachment-0001.htm>


More information about the gpfsug-discuss mailing list