*BSD News Article 83582


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!newspump.sol.net!ddsw1!news.mcs.net!hammer.uoregon.edu!hunter.premier.net!feed1.news.erols.com!howland.erols.net!EU.net!usenet2.news.uk.psi.net!uknet!usenet1.news.uk.psi.net!uknet!dispatch.news.demon.net!demon!awfulhak.demon.co.uk!awfulhak.demon.co.uk!awfulhak.demon.co.uk!not-for-mail
From: brian@anorak.utell.net (Brian Somers)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Subtle difference between "real" ksh and FreeBSD ksh ?
Date: 25 Nov 1996 18:01:48 -0000
Organization: Coverform Ltd.
Lines: 43
Sender: brian@awfulhak.demon.co.uk
Message-ID: <57cmuc$2ob@anorak.utell.net>
References: <stanbE1EpwA.Gqv@netcom.com>
Reply-To: brian%anorak.coverform.lan@awfulhak.demon.co.uk
NNTP-Posting-Host: anorak.coverform.lan
X-NNTP-Posting-Host: awfulhak.demon.co.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.8

In article <stanbE1EpwA.Gqv@netcom.com>,
	stanb@netcom.com (Stan Brown) writes:
: 	I am having a little trouble with the ksh that is provided with
: FreeBSD.
: 
: 	here is the nature of the problem. I have a failry comples promptthat I
: use on several deifferent machines. Here is how it's set up
: 
: -----------
: 
: if [[ $TERM = "xterm" ]] ; then
: PS1="]0\;$LOGNAME@$NODE;"'${PWD}'"$LOGNAME@$NODE:"'${PWD}\
: $ ' 
: else
: PS1="
: $LOGNAME@$NODE:"'${PWD}\
: $ '
: fi
: 
: -----------
: 
: 	This prompt gives me the name of the machine that I am on, and the
: current working directory on any terminal. If the terminal is an xterm, it
: puts the same thing in the title of the xterm.
: 
: 	This works on HP, Su, and Linux versions of ksh. With the freeBSD
: version, if it's not an xterm, it *almost( works. The only problem is the
: lack of a newline at the end of the prompt. On a xterm it's horibly broke.
: I get no prompt at all. I think the proble lies in how backslashed escaped
: sequences are interperted.

Well, the *almost* working version is correct.  If you escape the newline,
you're telling the shell to ignore it.  If you don't escape it, it works
fine (you must of course quote it).

I don't know about the xterm escape sequences - they screw up command-line
editing too much for me to use them :)

-- 
Brian <brian%anorak.coverform.lan@awfulhak.demon.co.uk>
      <http://www.awfulhak.demon.co.uk/>
Don't _EVER_ lose your sense of humour....
.