Concatenate piped output and some var?

Hello,

There is pipe chain and I want concacenate piped data with some variable:

balh blah| ... $var1

What command I should use instead ... to concatenate piped output with $var1. I think I coud solve this using temp var - but could it be done in one line like sample above ?

thanks
Vilius

var1=${var1}$(blah blah commands)

You can store the output of the pipe to a variable by using the following way.

read var <<<`ls|grep "count"`

echo $var

Now the $var contains the file names which contains the string count in it.

We can do in some other way too

var=`command1|command2` 
echo $var

Is that the thing you want ?

If need to read more than one variable, then ex. to use read also thisway:

read var1 var2 <<EOF
$( cmd1 | cmd2 )
EOF

same using nice format, but works only in ksh.

cmd1 | cmd2 |  read var1 var2