As stated in this question (and especially in John1024's answer, | is a metacharacter and hence, does not need spaces around it.
It makes me really confused because when I try to pipe a command I get an error "<cmd>: command not found". If I delete the space after the pipe symbol, the command runs perfectly. Even stranger: after successfully piping a command, I can run the same command with a space after the pipe symbol.
For instance :
man bash | grep foowill return-bash: grep: command not foundman bash |grep foowill output 3 lines containing 'foo'man bash | grep foowill now run and output the 3 same lines
I'd be really grateful if anyone could explain this behavior