LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-2010, 03:42 PM   #16
gavinz
LQ Newbie
 
Registered: Nov 2009
Posts: 6

Rep: Reputation: 1

Have you tried my suggestion? Did it work?
 
Old 03-15-2010, 04:10 PM   #17
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Original Poster
Rep: Reputation: 120Reputation: 120
Hi,
Sorry I didn't see your previous reply - I may well owe you a pint though!
I tried setting PS1 to just "> " and did some typing and it worked fine! Woohoo!!!
However - I can't seem to get my PS1 prompt to display correctly...

This is how it is currently in my .bashrc:

Code:
export PS1="\e[0;31m\H \e[0;34m\W\e[m $ "
I've tried several combinations but I think I'm missing a trick somewhere - I'm not great with bash special characters!
 
Old 03-21-2010, 04:32 AM   #18
gavinz
LQ Newbie
 
Registered: Nov 2009
Posts: 6

Rep: Reputation: 1
Quote:
Originally Posted by devnull10 View Post
Hi,
Sorry I didn't see your previous reply - I may well owe you a pint though!
I tried setting PS1 to just "> " and did some typing and it worked fine! Woohoo!!!
However - I can't seem to get my PS1 prompt to display correctly...

This is how it is currently in my .bashrc:

Code:
export PS1="\e[0;31m\H \e[0;34m\W\e[m $ "
I've tried several combinations but I think I'm missing a trick somewhere - I'm not great with bash special characters!
I've tried both your current PS1 (which breaks), and the following one, which seems to work correctly:
Code:
export PS1="\[\e[0;31m\]\H \[\e[0;34m\]\W\[\e[m\] $ "
(I believe that the reason that I missed out "\[" and "\]" before was that I had a missing termcap entry for one of my terminals on an old installation, and it worked slightly better without them. This is no longer the case so I can do it properly now.)
 
Old 03-21-2010, 05:41 AM   #19
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Original Poster
Rep: Reputation: 120Reputation: 120
Top man, that works great.
Cheers!
 
  


Reply



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
Sed append text to end of line if line contains specific text? How can this be done? helptonewbie Linux - Newbie 4 10-23-2013 01:48 PM
End-of-line Characters missing from last line of md5 file. Md5sum fails mehorter Linux - General 5 06-29-2009 08:56 PM
Attempting to append a line of text to the end of the previous line market_garden Linux - General 4 12-11-2008 11:37 AM
C: fread to read a file line by line until the end Blue_muppet Programming 2 09-19-2008 09:42 AM
php - Read file line by line and change a specific line. anrea Programming 2 01-28-2007 01:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:31 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
Open Source Consulting | Domain Registration