Piping grep causes error $'\302\240grep': command not found on linux

2

Sometimes when piping some input to grep, I see this error come up:

$ cat something.txt | grep "some text"
-bash: $'\302\240grep': command not found

When I re-type the command, it works as expected. What could be the cause?

I'm using Finnish keyboard layout.

1615903

Posted 2015-02-16T09:29:10.050

Reputation: 141

1BTW you don't need to use cat for this -- just use grep "some text" something.txt. – Gordon Davisson – 2015-02-16T17:01:21.817

Answers

2

Key-combination for pipe symbol in Finnish layout is Alt Gr + the key left of Z. The problem was that I didn't release Alt Gr before pressing space after the pipe character, and that caused a non breaking space to be inserted instead of normal space.

1615903

Posted 2015-02-16T09:29:10.050

Reputation: 141

It's NO-BREAK SPACE (to use the Unicode name) and it isn't really that weird. Finnish isn't the only multilingual keyboard layout where multiple characters are typeable with the spacebar. It's also the case for the German T2 layout, for example. – JdeBP – 2015-02-16T12:48:29.150