echo $var | grep -e "Some"
é, na verdade, a abordagem correta. Ao enviar a saída pelo grep com |
, ela não aparecerá mais no console. Da página de manual do Bash :
Pipelines
A pipeline is a sequence of one or more commands separated by one of the control operators
|
or|&
. The format for a pipeline is:[time [-p]] [ ! ] command [ [|│|&] command2 ... ]
The standard output of
command
is connected via a pipe to the standard input ofcommand2
. This connection is performed before any redirections specified by the command (see REDIRECTION). If|&
is used, the standard error ofcommand
is connected tocommand2
's standard input through the pipe; it is shorthand for2>&1 |
. This implicit redirection of the standard error is performed after any redirections specified by the command.