Re: which echo understand \n
On Thu, Jun 01, 2000 at 05:03:09PM -0300, suntong001@yahoo.com wrote:
> hi,
>
> The /bin/echo I used to use in Solaris understand \n and \t stuffs
> by default. Is there any trick I can play so that I don't need to
> specify the -e parameter for echo?
>
> The reason I'm asking is that debian is the only un*x I've used that
> /bin/echo don't interprate \n... by default. I've already wirtten
> tons of scripts using /bin/echo. Please help.
In a script, it's considered good practice (well, by some) to create
environment variables for executables. Usually the argument is that you
can then invoke the executable without worrying about path. You can
also specify arguments though, if needed.
For your script:
o Change all occurances of "echo" to "$echo" (you might want to
confirm).
:1,$g/echo/s//\$echo/g
o Add:
echo="/bin/echo -e"
...and you're set.
--
Karsten M. Self <kmself@ix.netcom.com> http://www.netcom.com/~kmself
Evangelist, Opensales, Inc. http://www.opensales.org
What part of "Gestalt" don't you understand? Debian GNU/Linux rocks!
http://gestalt-system.sourceforge.net/ K5: http://www.kuro5hin.org
GPG fingerprint: F932 8B25 5FDD 2528 D595 DC61 3847 889F 55F2 B9B0
Reply to: