deprication of echo

Kenneth.ray kenneth.ray at travelersla.com
Fri Aug 23 14:52:08 CEST 2002


This has been bugging me for quite sometime can someone please explain
it like im a 3-year old..
I agree echo -e is not portable but why use the e switch  in the first
place. if you surround the message in qoutes, echo works nicely, I
tested it on AIX redhat, and Solaris. Can anyone show me a instance
where  the output would not work? I have a couple  of custom scripts and
I use echo extensively throughout my configs and within my homegrown
scripts.  This just bugs me to no end becuase Echo was designed to be
just like a parrot, what you see is what you get.  it even works in NT
(though with NT the qoutes are displayed. IE:echo "this is a message"
comes out as "this is a message")

also if your using the -e switch, dont, -e is not available in all forms
of echo, enclose it in qoutes and like me, it should work fine..
feel free to educate this misguided individual(me) into the advantages
of using printf over echo  since it appears that Echo is actually more
portable than printf (printf dont work in NT, not that this matters but
if we are talking portability...)
and since its simple, why not keep it simple.)

just my three cents on the echo versus printf subject..


Message: 10
Subject: Re: [netsaint] Notification message truncated
From: Karl DeBisschop <kdebisschop at alert.infoplease.com>
To: Stanley.G.Martin at mail.sprint.com
Cc: netsaint-users at lists.sourceforge.net
Date: 22 Aug 2002 10:23:53 -0400

On Thu, 2002-08-22 at 10:04, Stanley.G.Martin at mail.sprint.com wrote:
> I found my answer.  Found a README in the source that mentioned using
> 'echo -e' instead of 'printf' and that worked.

It may work, but it is not portable. That's why it was deprecated in the

distribution in favour of printf which is portable.

--
Karl




-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390




More information about the Users mailing list