How to extract a number from a string (not a file) in Bash

export hobba=ksjdjf123ksks
export nokka=`sed “s/[^0-9]//g” <<< $hobba`
echo $nokka


About SoCRaT

Systems Engineer, OSS & Linux Geek
This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s