I have created a shell script in a file named strings
referring to that post:
#! /bash/sh
original_string='i love Suzi and Marry'
string_to_replace_Suzi_with='Sara'
result_string="${original_string/Suzi/$string_to_replace_Suzi_with}"
after that I have created an executable file referring to that post:
chmod +x strings
but if I run the file like that:
./strings
I get the issue:
./strings: 5: ./strings: Bad substitution
How can that be possible? I have just copied and pasted the sample code.