[Solved] change echo default setting to -e in Etch
I have a problem with the default setting for "echo" command in Debian.
I have hundred of old scripts written for AIX and /bin/ksh. These I want to run in Debian Etch and /bin/ksh.
The Problem is, AIX "echo" command does not even know of the -e option. Therefore there is in none of the scripts a "echo -e " present when \ Escape sequences are used to echo non-printable characters.
ksh does not have an internal echo command, so it uses the system wide one. As Debian "echo" command defaults to -E (which ignores these Escape sequences and prints them as ASCII), I cannot run these scripts under Debian Etch.
I also cannot and do not want to change all the scripts to be echo -e instead of echo, as they still have to run on AIX (and other linux distributions). I would have to deeply edit any script and add a OS agnostic solution. Not an option.
Is there a switch to set to change that default behaviour?
I stumbled over some more or less dirty hacks to come around this.
- insert a script "echo" somewhere in the PATH before /bin (but what is before /bin in every PATH variable? not really a solution, unless deeply hacking into the system
- move /bin/echo to /bin/echo-bin and replace it with a script /bin/echo *shudder*
- remove ksh from the installation and replace it with a script that lauches a bash shell (which has an internal echo command that you can set the behaviour of) and sets the readline mode to vi. The users would probably never recognize the difference. But I am pretty sure some of the scripts will break
- recompile the package that provides echo command (think this has to be glibc) with more usable default settings *wild_shudder*
I would rather not use one of those "solutions". I think it is obvious why not.
So please show me what I am missing.
Thanks in advance for any tip,
Edit: Problem solved [kinda].
pdksh provides an internal echo command with a more "compatible" behaviour. Lets see if some of the scripts crash.
Last edited by fangorn; 03-13-2007 at 07:31 AM.