LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
Configuring Bourne Shell


Hi

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:

http://cnm-minibook-mucking-about.bl...erm-shell.html

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
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,151

Rep: Reputation: 99
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
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,516

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
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):
Code:
# 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:
Code:
PS1='\u@\h:\w\$ '
And don't forget to define PS2 while you're at it
Code:
PS2='> '
And then be sure to export them
Code:
export PS1 PS2
 
Old 03-15-2009, 09:27 AM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

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


Reply


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


All times are GMT -5. The time now is 12:34 PM.

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