DebianThis forum is for the discussion of Debian Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
[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.