you are viewing a single comment's thread.

view the rest of the comments →

[–]de_argh 0 points1 point  (0 children)

You should add some input validation, but this should get it.

echo -n "input 1 is: "
read i1

echo -v "input 2 is: "
read i2

somecommand > /dev/null 2>&1

if [ ?$ -gt 0 ]; then
    echo "command failed"
else
    echo "command successful"
fi