subcadena en shell script
STR="birthday-091216-pics"
SUBSTR=$(echo $STR | cut -d'-' -f 2)
echo $SUBSTR
Unsightly Unicorn
STR="birthday-091216-pics"
SUBSTR=$(echo $STR | cut -d'-' -f 2)
echo $SUBSTR
INPUT='someletters_12345_moreleters.ext'
SUBSTRING=$(echo $INPUT| cut -d'_' -f 2)
echo $SUBSTRING
# You can do it in two ways
# 1) Let "grep" read on its standard input
echo "$line" | grep -o select
# 2) tell "grep" here is the string
grep select <<< "$line"