scriptoutput=$(script.pl ${arg1} ${arg2} 2>&1) echo "number returned from script -> ${scriptoutput}"