Answers for "substring in shell script"

1

how to print substring in bash script

INPUT='someletters_12345_moreleters.ext'
SUBSTRING=$(echo $INPUT| cut -d'_' -f 2)
echo $SUBSTRING
Posted by: Guest on September-05-2020
1

substring in shell script

STR="birthday-091216-pics"
SUBSTR=$(echo $STR | cut -d'-' -f 2)
echo $SUBSTR
Posted by: Guest on October-29-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language