LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 07-17-2004, 12:06 PM   #1
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Rep: Reputation: 30
help with ~.bash


first of all i am new at bash, i just heard of it and I want to save my export PS1="............" so next time I login I will see it.

oh yea i have edited the file .fluxbox\menu and made a transparent prompt

(aterm) {aterm -tr}


I just want to know how can i save my PS1

thanks
 
Old 07-17-2004, 12:40 PM   #2
JDandy
LQ Newbie
 
Registered: Jan 2004
Posts: 15

Rep: Reputation: 0
your PS1 variable is in ~/.bashrc you can change the variable using your favorite editor and the issue a ". bashrc" to load your new config file into the current session.
 
Old 07-17-2004, 04:23 PM   #3
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Original Poster
Rep: Reputation: 30
Unhappy

i don't know what u mean

but i have created a file called .bashrc and add the line export PS1="\e[32;1mPaxmaster>\e[0m\e[31;1m"

it works but i can't save the setting
 
Old 07-17-2004, 04:47 PM   #4
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
maybe create a ~/.bash_profile
and reference your ~/.bashrc in it...........
 
Old 07-17-2004, 05:11 PM   #5
JDandy
LQ Newbie
 
Registered: Jan 2004
Posts: 15

Rep: Reputation: 0
can you post what is in your ~/.bashrc
also if in the terminal session where you changed the PS1 var try issuing a . ~/.bashrc and see if the prompt changes to something other than what you set it to.

What linux and version are you using? In some you have to edit the ~/.profile file - depending on what your shell is set to.

Good luck,

JD

Last edited by JDandy; 07-17-2004 at 05:17 PM.
 
Old 07-17-2004, 07:26 PM   #6
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Original Poster
Rep: Reputation: 30
sh-2.05b$ echo $SHELL
/bin/sh
I am using a slackware base verison (collegelinux)

sh-2.05b$ cat .bashrc
sh-2.05b$ export PS1="\e[32;1mPaxmaster>\e[31;1m"
this works but when i try to exit from aterm then enter to aterm the setting is gone

sh-2.05$ cat .bash_profile
source ~/.bashrc

I am using fluxbox as my x window

also when i want to beconme su the prompt don't become # it stay like this paxmaster>
how should i know when i am root or when i am a user

I don't know what's wrong with my shell as u can it is a /bin/sh

thanks
 
Old 07-18-2004, 11:05 PM   #7
JDandy
LQ Newbie
 
Registered: Jan 2004
Posts: 15

Rep: Reputation: 0
Instead of putting the PS1 variable in ~/.bashrc put it in ~/.profile and that may take care of it. Good Luck,

JD
 
Old 07-19-2004, 12:03 AM   #8
statmobile
Member
 
Registered: Aug 2003
Location: Chapel Hill, NC
Distribution: Gentoo, Windows 95 2000 & XP
Posts: 160

Rep: Reputation: 30
Check out this tutorial, I found it extremely helpful
Prompt Magic
 
Old 07-19-2004, 09:30 AM   #9
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 804

Rep: Reputation: 186Reputation: 186
PS1 in bashrc

Earlier versions of Linux (7.1 redhat for instance) needed to make PS1 changes in /etc/bashrc - which got executed before the individual file. So you may try it.

HTH

End
 
Old 07-21-2004, 11:56 AM   #10
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Original Poster
Rep: Reputation: 30
yea thanks i fix the problem
also how can i put color or add more detail in my aterm toolbar for example to show \w\d
 
Old 07-21-2004, 04:58 PM   #11
statmobile
Member
 
Registered: Aug 2003
Location: Chapel Hill, NC
Distribution: Gentoo, Windows 95 2000 & XP
Posts: 160

Rep: Reputation: 30
did you read the link I provided? It's really quite helpful!
 
Old 07-22-2004, 02:23 PM   #12
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Original Poster
Rep: Reputation: 30
Talking

yea and i printed the pages. it was great quite usefull
the problem was the /etc/bash_profile the program wasn't looking at my home ~/.bashrc nor ~/.bash_profile, it was overriding by home dir

mean while i type the PS1 in my /etc.. and it works, but soon i will write a program that will frist look in the home dir if is has a bashrc it will use that instead in my /etc place thanks guys for the help

the link u provide (statmobile) I got another idea

"\e]2;titlebar\a" but this don't work for me some reason at least my prompt color is working, -
 
Old 07-22-2004, 05:07 PM   #13
statmobile
Member
 
Registered: Aug 2003
Location: Chapel Hill, NC
Distribution: Gentoo, Windows 95 2000 & XP
Posts: 160

Rep: Reputation: 30
Personally, this is how I setup my prompt:
Code:
export PS1="\[\e]2;\u@\H\w\a\e[34;1m\]\u\[\e[34;m\]@\h:\[\e[33m\]\W\[\e[32m\]\$\[\e[0m\] "
It dynamically updates the titlebar. I'm not sure if you replaced the text 'titlebar' that you referred to, so I just thought I would give you my prompt code.

Last edited by statmobile; 07-22-2004 at 05:08 PM.
 
  


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
$LINENO can't be modified in bash 3.0, while it can be in bash 2.05b Darwish Linux - Software 1 11-07-2005 03:57 PM
bash my little bash alaios Linux - Newbie 4 01-11-2005 12:59 AM
bash + html + javascript or just bash ? rblampain Programming 4 12-01-2004 08:53 AM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 07:42 PM
Bash Half_Elf Linux - General 2 05-01-2002 07:39 PM


All times are GMT -5. The time now is 10:01 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