I am trying to execute the below command from a shell script:
perl -pi -e 's/Ç/|/g' diff_new_old.dat
This command gets executed without any errors, but the execution doesn't do the intended substitution. It doesn't seem like shell has an issue with execution of perl command, since perl -pi -e 's/\n/\r\n/g' diff_new_old.dat
works fine. It looks like an issue with special character substitution.
When I execute the same command directly on $ prompt, it executes fine and substitutes all Ç characters with | in the file. I want to automate this process and thus need a way to get this done from a shell script.
I have also tried using the sed 's/Ç/|/' command. But this results into below error: sed: -e expression #1, char 6: unterminated `s' command
Please let me know what I can do to achieve the substitution.
Thanks in advance.