You have numerous syntax mistakes.
tmp1=$(bzcat all.tbz)
echo "$tmp1" | tar x
- Assignments can't have spaces around
=
.
- Use
$(...)
to execute a command and substitute its output.
- Put
$
before the variable name when echoing it.
- Put
"
around the variable to prevent word splitting and wildcard expansion of the result.
But this most likely still won't work because tar files contain null bytes, and bash variables can't hold this character (it's the C string terminator).
If you just want to capture the error message if there's a failure, you can do:
tmp1=$((bzcat all.tbz | tar x) 2>&1)
if [ ! -z "$tmp1" ]
then echo "$tmp1"
fi
See Bash script - store stderr in a variable