Answers for "linux get part of string"

0

linux get part of string

INPUT='someletters_12345_moreleters.ext'
SUBSTRING=$(echo $INPUT| cut -d'_' -f 2)
echo $SUBSTRING
Posted by: Guest on May-31-2021
0

linux get part of string

b=${a:12:5}
Posted by: Guest on May-31-2021
0

linux get part of string

number=$(echo $filename | egrep -o '[[:digit:]]{5}' | head -n1)
Posted by: Guest on May-31-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language