Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-15-2009, 07:48 AM   #1
Registered: Mar 2009
Distribution: Lubuntu 13.10
Posts: 40

Rep: Reputation: 0
Configuring Bourne Shell


This is more of a request for info rather than help.

I have a Cnm Minibook that uses the Bourne Shell. I was trying to amend it's startup file to change prompt and add aliases. On googling, I found that the Bourne shell's startup files are located in /etc/profile and $HOME/.profile.

The details of what I did is in my blog:

I them did the same on the Bourne Shell on my Ubuntu machine and amended the /etc/profile and $HOME/.profile by changing the prompt to:

PS1='\u\w> '

When I type in sh to go into Bourne shell it still displays


Is this the normal behaviour of the Bourne Shell?
Old 03-15-2009, 09:15 AM   #2
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
try /bin/bash and see if it works that way. also I believe the file edited should be ~/.bash_profile or ~/.bashrc generally if anything needs to be applied across all accounts then their is /etc/bashrc too I believe as ~/.bash_profile points at ~/.bashrc and ~/.bashrc points at /etc/bashrc but I use CentOS mainly what is Red Hat based, could be different for Debian based distros.
Old 03-15-2009, 09:27 AM   #3
Senior Member
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
In, say, /etc/profile you can set the prompt system-wide (and remember that you have to log out and log back in again for any changes you make to take effect):
# Get the name (without the domain part) of the host (this is fancy-schmancy)
export HOST="`uname -n`"
# Set the prompt system-wide
PS1='${HOST}-${USER}-${PWD}: '
Note the use of double quotes and "sideways pipe" in the assignment of HOST and the use of single quotes in the assignment of PS1.

Ought to work for you this way (or modify as you see fit).

A bare-bones default might look like this:
PS1='\u@\h:\w\$ '
And don't forget to define PS2 while you're at it
PS2='> '
And then be sure to export them
export PS1 PS2
Old 03-15-2009, 09:27 AM   #4
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 15.0
Posts: 8,134
Blog Entries: 61

Rep: Reputation: Disabled
I think sh in Ubuntu is a link to dash, not bash.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bourne Shell Programming help! radmofopunk Programming 27 04-24-2006 04:13 AM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 10:20 AM
Bash Shell vs Bourne infamous41md Linux - Newbie 14 04-11-2003 11:16 PM
Bourne Again SHell help MagInnovision Linux - Newbie 2 02-04-2003 04:43 PM
Bourne shell programming noodle123 Programming 3 04-16-2002 04:46 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration