writing a small script to perform house keeping tasks on my servers.
I want to grab just the X in ethX,
echo `grep -m1 -oE "eth[0-9]*" /etc/network/interfaces | grep -oE [0-9]*`
this works, but I was wondering if someone knew a one time command that can do it, ie a regular experession that can take a word for instance, room456 and only spit out the number.
Use positive lookbehind to match any digit string that is preceded by
eth: