Extract Numbers from String

Extract all numbers from a string.

Code

General
echo "$str" | grep -oE '[0-9]+' | tr '\n' ' ' | sed 's/ $//'

Parameters

The string to extract numbers from

Server

More Bash Snippets