I tried to get "hello" ,but this not work ,it between third and fourth appear of character i
echo "ixaifsdaihelloihd" | grep -oP '(?=i{3}).*?(?=i{4})'
CodePudding user response:
echo "ixaifsdaihelloihd" | cut -d'i' -f4
CodePudding user response:
echo "ixaifsdaihelloihd" | grep -oP '^(?:[^i]*i){3}\K[^i] '
or
awk -F'i' '{print $4}' <<< "ixaifsdaihelloihd"