I have this inline sed command:
sed -e 's/^M/\'$'\n/g' filename.txt
which is working inline, but not inside a bash script:
#!/bin/bash
sed -e 's/^M/\'$'\n/g' $1
Removing \'$' from the code doesn't solve the problem (replaces ^M with just an "n").
Cheers, Andrea