I have elaborated an awk command which gathers the output of a shell:
val=$(./cli.sh --file=scripts/monitor.sh | awk '/result/{print $3}')
echo $val
Returns:
"75"
As you can see the output is correctly returned, however I'd need to cast it to integer. Is there an awk function to do it?