bug-grep
[Top][All Lists]
Advanced

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

bug#25651: Weird output of random files


From: address@hidden
Subject: bug#25651: Weird output of random files
Date: Tue, 7 Feb 2017 21:24:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

Hello,

I could repeatedly reproduce an unexpected behaviour on several Linux systems (two installations of Arch Linux [newest state], a Debian [8.7] and a Ubuntu [16.4]).

I ran the following command - when I first ran it, it was accidentially

ps ax | grep -reh

I wanted to grep for processes containing the string "-reh", but forgot the "-e" which was necessary due to the leading dash in the string.

On all systems, grep outputs hundreds of (not even matching) lines from files of my home directory, not at all related to the output of ps, which I piped into grep.

Maybe, the command line is interpreted as:

   * r ... search files recursively in directories. Note, that input is
   read from stdin here.

   * e ... use the following pattern

   * h ... this is the pattern expected by "e"

It may be that all the lines ouput by grep contain "h".

Although expected to be identical, this command works as expected:

ps ax | grep -reh /dev/stdin

Kind regards,

rexkogitans




reply via email to

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