I want to accomplish the equivalent of the following pseudo-code in bash (both a and b are inputs to my script) :
String a = "some long string";
String b = "ri";
print (a.substring(a.firstIndexOf(b), a.length()); //prints 'ring'
How can I do this in shell script?
You can do: