I have a command line program that prints out a report such as:
I found 0 problems on your database,
0 problems were found on your database
and so on.
I would like to write a linux shell script that exports the number only to a variable. I can’t find the correct way of doing so. I suspect I am not using grep properly (or there’s a better command);
i.e.
I found 43 problems on your database,
43 problems were found on your database
$VAR=43
please advise
1 Answer