Instead of `echo $x | grep ...` or `echo $x | sed ...`, you can use `grep ... <<<$x`. Slightly faster, as you don't need to invoke a sub-shell.