Y
Hacker News
new
|
ask
|
show
|
jobs
by
mortehu
3160 days ago
Just pipe the output through cat. By default, the "pipefail" option is not set, so
echo foo | grep bar | cat
is successful. Of course, this works for any command.
1 comments
nerdponx
3160 days ago
Alternatively and less wastefully:
echo foo | grep bar || true
link
teddyh
3160 days ago
Alternatively and shorter:
echo foo | grep bar || :
link