APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

echo newlines

From: Giulio Orsero <giulioo@pobox.com>
Newsgroups: comp.unix.sco.misc
Subject: Re: Problem w/ echo
Date: Sun, 31 Dec 2000 11:10:57 +0100
Message-ID: <92n0nm$7loj9$1@ID-59665.news.dfncis.de> 
References: <923af3$eut$1@venus.telepac.pt>
<3A4E59F7.EAEC7458@squonk.net> "Brian K. White" <linut@squonk.net> ha scritto: >> 2) under bash-2.x >> just add in /etc/profile >> shopt -s xpg_echo >> and you should be set

>Just tried this with the bash 2.03 from skunkware for sco osr5
>when used with an account that has bash as the login shell 
>all I get is:
> bash: shopt: xpg_echo: unknown shell option name
I looked at the bash CHANGES file and the option I suggested is there
starting in 2.04 (used in RedHat7.x)
With previous versions you have to configure bash with
--enable-usg-echo-default (that now is --enable-xpg-echo-default) at
build time, that is something similar to bash-1.x.

with bash-2.04:
$ cat file1
echo "hi\n"
$ ./file1
$ echo "hi\n"
$ shopt -s xpg_echo
$ ./file1
$ echo "hi\n"

>convenient if I could use bash on osr5 without it breaking all the system
>scripts that don't have any #!/bin/sh at the top
If you use bash2 there should be no problem (using scripts without
anything at the top), but if you ever should use bash-1.x (RedHat6.x and
others), then see
For that reason we had to add "#!/bin/sh" at the top of every script;
this allowed us to keep using scripts developed on other unix systems
both on those systems and on linux (where sh is linked to bash).

I said that with bash-1.x you need to use a compile time option;
actually, reading the bash man page one may think he can make it work
runtime (without editing scripts) using an alias and setting $BASH_ENV
appropriately; unfortunately, I tried hard for many days to make it work
without success, so that I rebuilded the rpm and never thought of it


Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> echo newlines ––>Re: Problem w/ echo

Increase ad revenue 50-250% with Ezoic

Kerio Samepage

Have you tried Searching this site?

Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

The idea of "work, then get paid" has been deeply ingrained in our culture by employers who want to limit their risk. Well, I like to limit my risks also. I like to get paid before I do work. (Tony Lawrence)

This post tagged: