Sometimes on my terminal (Ubuntu) when I type:
ls | grep toto
I get this error:
grep: command not found*
Notice that the shell is writing grep prefixed by a space. How can this be possible?
<Checks the source of your original question>
<pre style="width:650px; white-space:pre-wrap">Sometimes on my terminal (Ubuntu) when I type : ls | grep toto
Thank you for copy-pasting the actual line! (But you didn't copy-paste the error message, naughty you!) See the problem? You have an unbreakable space after the pipe symbol. Shells only understand ASCII characters; all non-ASCII characters, including U+00A0 NO-BREAK SPACE, are treated as word constituents, so that unbreakable space is treated as part of the word that's in command name position.
You're presumably using a keyboard layout where you need to hold down AltGr to type |
. Make sure to release the AltGr modifier so as not to accidentally type AltGr+Space instead of Space. Note that you don't need a space there, you can type ls |grep toto
if that's easier on your fingers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With