Date: Wed, 30 Jan 2002 22:20:50 -0600 From: Timothy Covell <timothy.covell@ashavan.org> To: gwq_uk@yahoo.com, timothy.covell@ashavan.org Cc: FreeBSD-questions@freebsd.org Subject: Re: Echo "\c" does not work Message-ID: <200201310418.g0V4IkL29637@home.ashavan.org.> In-Reply-To: <20020131034032.28076.qmail@web13305.mail.yahoo.com> References: <20020131034032.28076.qmail@web13305.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 30 January 2002 21:40, Greg Quinlan wrote: > Timothy, > > The man page that I am looking at says -n but that this can also be > achieved by \c > > man echo > Yeah, but it also says "see also built-ins" . The shell's builtin echo and /bin/echo are do not act the same. Try the both of them and verify it for yourself. And, it is because of this confusion that I always explicitly use "/bin/printf" instead of echo for anything that's not a throw-away script (and even then, I try to use printf because it's just as easy and throw-away scripts have a nasty habit of being added to or taken over by others.) Of course, you are free to use whichever you want. > --- Timothy Covell <timothy.covell@ashavan.org> wrote: > > On Wednesday 30 January 2002 20:27, Greg Quinlan wrote: > > > Hello all, > > > > > > This is quite a small thing but does anyone know why echo "\c" does not > > > work. It is suppose to echo without a new line. > > > > > > I am doing a cut-over of a SCO System (IBCS2) to FreeBSD and I have > > > loads of shell scripts with echo no new line done this way. The man > > > page says it is valid. I do know "echo -n" > > > > > > Thanks > > > > > > Greg > > > > Methinks that you want to use printf which uses these control characters. > > Echo is tempting to use, but quickly leads to problems. It should be > > simple to write a script to replace all "echo" statements with "printf", > > but then you will need "\n" to be properly placed. > > > > > > -- > > timothy.covell@ashavan.org. > > __________________________________________________ > Do You Yahoo!? > Great stuff seeking new owners in Yahoo! Auctions! > http://auctions.yahoo.com -- timothy.covell@ashavan.org. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201310418.g0V4IkL29637>