to space or not to space when using pipe
Using bash 4.2 in Debian 7.1 Wheezy. But this is a question of bash in general.
When using pipe (|) should there be a space before and after the pipe? When searching for scripts on the net, I come across a lot of scripts that have a space after the pipe. As a general good habit, I try to always not have a space after the pipe. So the question as Shakespeare would say: to space or not to space when using pipe. That is the questtion. Thanks |
Hi there,
Quote:
Just use spaces if you like, or don't use them if you like that. Whatever pleases your eye. From a technical point of view, there's no difference. I prefer to use a space before and after the pipe character for the sake of clarity. [X] Doc CPU |
If the space worries you that it might be an argument, it won't. As an example:
Code:
echo -n abc | ( cat; echo xyz; ) Also, Code:
echo a b c |
All times are GMT -5. The time now is 01:33 AM. |