This is not a UNIX/LINUX thing. Since the POSIX standard doesn't specify which behavior should be the default, it's left up to the individual shell
to decide how to implement it.
, the default shell on most linux systems, does not interpret baskslash forms by default, so you have to use the -e
option. I believe ksh
, on the other hand, does. I don't know about other shells.
You can use bash's xpg_echo
shell option to enable automatic interpretation.
Edit: To tell the truth, I'm not sure what you mean exactly by using echo "in cobol". Could you perhaps be using the external /bin/echo
in cobol programs?
If so, then the same issue as the above applies, and the gnu version of echo
is also designed without automatic interpretation. I don't know if there's any way to tell it to do otherwise; the documentation doesn't mention anything.
If you really want to solve your problem at the root, try switching everything to use printf
instead. It's more consistent across implementations.