TEXT="A very long text to read" echo "${TEXT#*very }" #the string after the substring "very" #output: #long text to read echo "${TEXT% to*}" #the string before the substring " to" #output: #A very long text