LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-13-2006, 06:58 AM   #1
jovie
Member
 
Registered: May 2006
Posts: 54

Rep: Reputation: 15
No default shell


Hi can anyone explain this?

Basically my users aren't getting the shell and therefore environment they want at login. I'm not sure what shell they get but it certainly isn't /bin/bash using their own .bashrc, even though /bin/bash is what they have set as default. (So maybe it's just not reading the .bashrcs?)

Code:
Last login: Thu Jul 13 12:01:44 2006 from ###.###.###.###
-bash-3.00$ echo $shell
 
-bash-3.00$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
-bash-3.00$ grep 'username' /etc/passwd
username:x:504:504::/users/username:/bin/bash
-bash-3.00$ ls -l /bin/bash
-rwxr-xr-x  1 root root 686520 May 10  2005 /bin/bash
-bash-3.00$ which bash
/bin/bash
-bash-3.00$ bash
[username@ ~]# echo $shell
 
[username@ ~]#echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
[username@ ~]# echo $shell
 
[username@ ~]#echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin/phred:.:/users/username/bin/Decoder:/usr/software/exec/phrap:/usr/software/exec/:/data/ncbi/::/usr/software/bin/
[username@ ~]#exit
exit
/bin/:/usr/software/GOtcha/bin/:/usr/software/bin/
[username@ ~]#exit
exit
Anyone know how I get users loging in to a bash shell with their own .bashrc settings?

(I have tried chsh but the default shell is already set to the shell I want to use)

Thanks
Ann

Last edited by jovie; 07-13-2006 at 07:04 AM.
 
Old 07-13-2006, 07:13 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Should echo $shell not be echo $SHELL?

The $shell/$SHELL variable is not global. I.e. echo $SHELL works for bash shells, $shell works for tcsh.

Hope this helps.
 
Old 07-13-2006, 07:35 AM   #3
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
can you not obtain what shell they are using (and also edit) from /etc/passwd?
 
Old 07-13-2006, 08:19 AM   #4
jovie
Member
 
Registered: May 2006
Posts: 54

Original Poster
Rep: Reputation: 15
[QUOTE=druuna]Hi,

Should echo $shell not be echo $SHELL?

/QUOTE]


Yes of course Thanks you.

Code:
-bash-3.00$ echo $SHELL
/bin/bash
So they're logging in to a bash shell but not getting the environment defined in their own .bashrc and as running bash starts a new shell with the .bashrc settings I don't think there's an error in .bashrc .

It's a problem for all users who all have default bash. root uses tcsh and reads ~/.tcsh fine.

There's no help in /var/log/secure or /var/log/messages. Anywhere else I could be looking?

Fedora core 4 BTW.

Thanks
Ann
 
Old 07-13-2006, 08:36 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

The config file(s) that are read when a bash shell is started depends on several things:

- is it a login shell,
- is it a interactive shell.

The ~/.bashrc file is only parsed if the bash shell is a interactive shell that is not a login shell.

~/.bash_profile, ~/.bash_logout and ~/.profile are parsed if the bash shell is an interactive login shell, or a non-inter-active shell with the --login option.

See the bash manpage (section: INVOCATION) for details.

Hope this clears things up a bit.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I made a shortcut to a shell script and it is using default shell icon... shlinux Linux - Software 2 04-20-2006 06:29 AM
new users' default shell r.stiltskin Debian 5 02-15-2006 04:27 PM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 09:20 AM
default shell aspargo Linux - Newbie 3 08-09-2004 03:38 AM
default shell IBP Linux - Newbie 2 12-21-2002 05:52 AM


All times are GMT -5. The time now is 09:27 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration