LinuxQuestions.org
Help answer threads with 0 replies.
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 07-17-2004, 11:06 AM   #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, 11:40 AM   #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, 03: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, 03: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, 04: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 04:17 PM.
 
Old 07-17-2004, 06: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, 10: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-18-2004, 11:03 PM   #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, 08:30 AM   #9
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
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, 10: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, 03: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, 01: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, 04: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 04:08 PM.
 
  


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

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

All times are GMT -5. The time now is 12:29 AM.

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