Using bash, lets say i have the following string
string="Same bought 5 bananas, 12 apples, 2 peaches and 16 oranges"
How can I trim everything except the nth number. In this case I want to output 12 which is the second number in the string.
How can I do that with bash, grep or sed?