I have a log line that I am pulling from bash like:
There are 5 apples and 7 oranges
And I want to get the 5 and 7 into bash variables and am having problems doing so.
awk ‘{ print $3, $6 }’ won’t work due to the fact that their position might change, if there are bananas. Bonus points if the digits can be associated with their fruits.
Thanks in advance
and to get the fruits: