is there a way to get indexOf of a substring after nth character in Bash, without needing to cut the original string one by one, that would be lengthy
12345678901234
$ expr index 'abcdeabcdabcaa' 'c'
3
$ expr index 'abcdeabcdabcaa' 'ca'
1
What i want would be:
$ indexOf 'abcdeabcdabcaa' 'ca'
12
$ indexOfAfter 5 'abcdeabcdabcaa' 'c'
8
$ indexOfAfter 5 'abcdeabcdabcaa' 'ca'
12
$ indexOfAfter 9 'abcdeabcdabcaa' 'b'
11
$ indexOfAfter 111 'abcdeabcdabcaa' 'c'
0
probably there are already function on Bash to do this.. this is not a homework, just out of curiosity..