LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-09-2003, 03:52 PM   #1
mattman
Member
 
Registered: Jun 2003
Distribution: Slackware
Posts: 49

Rep: Reputation: 15
no .bashrc?


ok, this is really wierd. im creating new users with the adduser command, and there is no .bashrc in the home dir. ive tried making one, but for some reason it doesnt execute when a user logs in. but for some reason, when i launch a terminal in gnome, it does read it. anyone know how to get it to read it on login?
 
Old 06-09-2003, 03:55 PM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
add this to your .bash_profile


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
 
Old 06-09-2003, 04:15 PM   #3
mattman
Member
 
Registered: Jun 2003
Distribution: Slackware
Posts: 49

Original Poster
Rep: Reputation: 15
lol, theres no .bash_profile either. and the problem isnt that the .bashrc isnt there, the problem is that it isnt executing
 
Old 06-09-2003, 04:21 PM   #4
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
.bashrc isn't executed automatically. it's called from
another file.

add that to /etc/profile if you want.
 
Old 06-10-2003, 07:57 AM   #5
cpv204
Member
 
Registered: Mar 2003
Location: Tribeca, NYC
Distribution: Slackware 9.0, Fedora Core 1
Posts: 111

Rep: Reputation: 15
mattman, this may shed a little more light on your situation.

bash can start in two modes, a login shell and a non-login shell. When you login at the CLI, bash starts a login shell. When you are running an xterminal, bash starts a non-login shell.

In a login shell, bash looks at /etc/profile and the first of ~/.bash_profile, ~/.bash_login, and ~/.profile

In a non-login shell, bash looks at ~/.bashrc

That's why your users logging in at the CLI do not have the .bashrc commands execute, but when you open an xterm in gnome they do.

As whansard has pointed out, most people just source ~/.bash_profile from ~/.bashrc, so you get the same stuff no matter what kind of shell starts up.
 
Old 06-10-2003, 09:27 AM   #6
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Rep: Reputation: 30
Thanks for clearing that up.

Last edited by snocked; 06-10-2003 at 09:28 AM.
 
Old 06-10-2003, 03:59 PM   #7
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
the command to make bash run like it's logging in
is bash --login
suprisingly enough.
 
  


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
where is bashrc ? Kanaflloric Slackware 12 10-06-2007 02:47 PM
.bashrc ? Longinus Linux - Newbie 2 03-27-2004 11:50 AM
.bashrc roofy Slackware 7 05-06-2003 01:32 PM
bashrc nobu Slackware 6 03-21-2003 10:53 AM
.bashrc prasad Linux - General 1 04-14-2001 09:51 AM

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

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