echo 'someletters_12345_moreleters.ext' | cut -d'_' -f 2
output
12345
ip route show | grep default | cut -d' ' -f 3
output
178.134.45.216
References
https://stackoverflow.com/questions/428109/extract-substring-in-bash
echo 'someletters_12345_moreleters.ext' | cut -d'_' -f 2
output
12345
ip route show | grep default | cut -d' ' -f 3
output
178.134.45.216
References
https://stackoverflow.com/questions/428109/extract-substring-in-bash