*BSD News Article 61906


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!metro!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!plug.news.pipex.net!pipex!tube.news.pipex.net!pipex!lade.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.mathworks.com!fu-berlin.de!zib-berlin.de!irz401!theatre.pandora.sax.de!mw
From: mw@theatre.pandora.sax.de (Martin Welk)
Subject: Re: Bug in ECHO?
Organization: Private Site, Member of Individual Network e. V.
Message-ID: <Dn45F4.LpB@theatre.pandora.sax.de>
References: <4famj5$4hf@complete.org> <4gb0lt$d34@uriah.heep.sax.de>
Date: Wed, 21 Feb 1996 06:45:04 GMT
Lines: 34

In article <4gb0lt$d34@uriah.heep.sax.de>,
J Wunsch <joerg_wunsch@uriah.heep.sax.de> wrote:

>jgoerzen@complete.org (John Goerzen) writes:
>
>> The echo command under FreeBSD is not properly expanding backslash escape
>> sequences.  I have several shell scripts that do not work right because of
>> this.
>
>The echo command in *BSD is not supposed to expand backslashes.  It
>should echo its argument, not interpret them.
>
>The functionality you are looking for can be found in printf(1).

Unfortunately, this is not directly available in shell scripts.

I made good experiences while porting bourne shell scripts from an
ancient System V Release 3 machine to FreeBSD using bash (Bourne-
Again-Shell.)

Sometimes it's a kind of philosophy if people like bash or not, but
at least, it works using the internal echo command - I even get more
functionality with it. I didn't want to convert everything to perl
or something like that, so using bash was the easier way for me.
And it works good, although performance could be better.

Bye,
    Martin
-- 
 /| /|        | /| /       \      ,,You know, there's a lot of opportunities,
/ |/ | artin  |/ |/ elk     \                 if you're knowing to take them,
                             \      you know, there's a lot of opportunities,
Meissen, Germany, Europe      \            if there aren't you can make them,
mw@theatre.pandora.sax.de      \         make or break them!'' (Tennant/Lowe)