LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-10-2004, 04:09 PM   #1
little_ball
Member
 
Registered: Oct 2003
Location: teddy bears Land
Distribution: Slackware 10
Posts: 176

Rep: Reputation: 30
put my user logon instead of bash prompt


Hi, i like to watch the fortune cookies stuff every time i open up a terminal. i now know the reason why kde 3.2.1 delete this issue it don't delete it, it just delete the user profile in the terminal so you don't see any message of fortune cookie. well i'm using aterm in kde 3.1.4 i want that instead of the typical bash$ that appears in the aterm terminal, i want it to appear user@machine$ like the usual one that appears in the kde console all the time. how i put that back but in aterm? i know how to delete user@machine$ from any terminal, but i don't know how to put it back. any tips?
 
Old 04-10-2004, 10:28 PM   #2
GT_Onizuka
Member
 
Registered: Aug 2003
Location: Atlanta
Distribution: Debian, OS X
Posts: 711

Rep: Reputation: 31
Your post was kinda hard to understand, I apologize if this isn't what you wanted but I have a feeling this will help you out.
 
Old 04-11-2004, 12:11 AM   #3
ponds
LQ Newbie
 
Registered: Mar 2004
Location: MSU
Distribution: Slackware
Posts: 24

Rep: Reputation: 15
Theres a flag to make aterm treat your shell as a login shell, I think -ls but im not sure; I know it is in the manual.
 
Old 04-11-2004, 12:14 AM   #4
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
You're experiencing the difference between a login shell and a sub-shell.
There are a few initialization scripts which bash reads when it starts up. If you log in, say in a regular old console, bash reads /etc/profile and /home/user/.bash_profile

When a subshell (xterms and the like) starts up, it only reads the file /home/user/.bashrc
Within /home/user/.bashrc you want to have the line:

source /etc/profile
and/or optionally:
source .bash_profile

That should fix everything for you.
KDE's Konsole does things differently, but I'm not sure what exactly.

--Shade
 
Old 04-11-2004, 10:22 AM   #5
little_ball
Member
 
Registered: Oct 2003
Location: teddy bears Land
Distribution: Slackware 10
Posts: 176

Original Poster
Rep: Reputation: 30
ok i be more clear, for example when you open up a console it shows this in the prompt

DEFAULT:
The hardware's, of course.

user@Slackware:~$

you can saw that

DEFAULT:
The hardware's, of course.

is the message of the fortune cookie, well is different when you open up aterm it shows only this:

bash-2.0.5$

Ok the thing is i want to open aterm and saw my user login instead of the bash-2.0.5$ i want to see this

user@Slackware:~$

how i put aterm, the same way that happens when i open a konsole. No bash-2.0.5$ yes user@Slackware:~$
 
Old 04-11-2004, 12:48 PM   #6
GT_Onizuka
Member
 
Registered: Aug 2003
Location: Atlanta
Distribution: Debian, OS X
Posts: 711

Rep: Reputation: 31
Okay, I get it and I was right. What you want to do is open up your .bashrc file in your home directory. There will be a chunk that looks like
PS1="[stuff in here]"
Change that to
PS1="\u@\h:\W$"
Check out the link I gave a few posts back, it gives all the commands that you can add to change the way it looks. You can add all sorts of stuff.
 
Old 04-11-2004, 01:09 PM   #7
little_ball
Member
 
Registered: Oct 2003
Location: teddy bears Land
Distribution: Slackware 10
Posts: 176

Original Poster
Rep: Reputation: 30
ohh yeah, but the problem is i don't have any .bashrc file in my home directory. i only have .bash_history which is a text file that have all the commands i have already use in bash. so what can i say, if konsole have the user login as default prompt where does it check it? so i could put it too in aterm.
 
Old 04-11-2004, 01:35 PM   #8
ringwraith
Senior Member
 
Registered: Sep 2003
Location: Indiana
Distribution: Slackware 15.0
Posts: 1,272

Rep: Reputation: 65
you can make your own .bashrc
 
Old 04-11-2004, 01:58 PM   #9
GT_Onizuka
Member
 
Registered: Aug 2003
Location: Atlanta
Distribution: Debian, OS X
Posts: 711

Rep: Reputation: 31
Yeah, just make one and put the PS1=blahblahblah thing I gave you. You can also make aliases and stuff like that with your .bashrc file. It's pretty nifty.
 
Old 04-11-2004, 10:00 PM   #10
bashrc2
Member
 
Registered: Feb 2004
Distribution: slackware 9.1
Posts: 106

Rep: Reputation: 15
a samble .bash_profile
#####################
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME=""
PS1="[\u@\h \w]\\$ " # this is what you wan to edit.

export USERNAME BASH_ENV PATH PS1
#################

now to change prompts just type "prompt" without the "" of course.
 
Old 04-13-2004, 01:57 PM   #11
little_ball
Member
 
Registered: Oct 2003
Location: teddy bears Land
Distribution: Slackware 10
Posts: 176

Original Poster
Rep: Reputation: 30
thank you it work very very well

PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME=""
PS1="[\u@\h \w]\\$ " # this is what you wan to edit.

export USERNAME BASH_ENV PATH PS1

now aterm show the user prompt instead of the tipical Bash prompt.
i'm so happy now.
 
  


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
bash prompt subG Slackware 6 01-18-2006 04:43 PM
Bash put script jnusa Programming 3 09-07-2004 02:31 AM
help with bash prompt everythingand2 Linux - Newbie 7 12-06-2003 04:28 PM
Bash Prompt mandraketux Mandriva 2 11-28-2003 10:05 PM
Samba/RH9/WinXP No Logon Prompt tcv Linux - Networking 1 07-26-2003 01:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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