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

echo newlines

© December 2004 (various authors)
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

Inexpensive and informative Apple related e-books:

Are Your Bits Flipped?

Photos: A Take Control Crash Course

Take Control of Numbers

Digital Sharing Crash Course

iOS 10: A Take Control Crash Course

Printer Friendly Version

Have you tried Searching this site?

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

Printer Friendly Version

C++: NSStringWithoutYourMothersHatButWithNiceCandyFrosting - aargh! (Tony Lawrence)

Linux posts

Troubleshooting posts

This post tagged:




Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode

SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)