I am looking how to bash script a hostname and grab everything in between numbers into a var. For example, let's say the hostname
is abcd1efghij12kl
. How do return just efghij
?
The number of letters before the first number varies and the number of letters after the second number can vary and inbetween.
Also to first number could be 1 or 2 digits and same for the second set of numbers. I am looking to get only the letters in between. When I try IFS i can't seem to get anywhere. Thanks