>>185
read line
if echo $line| command1; then
echo $line| command2
else
echo "ERROR"
fi