Operating System - HP-UX
1834394 Members
1784 Online
110066 Solutions
New Discussion

Re: su - does not change $SHELL

 
SOLVED
Go to solution
Mark Fisher_4
Frequent Advisor

su - does not change $SHELL

I create a new account and use csh shell:

marktest:HnpDwN/t6Jhjk:584:20:Mark Test,,,:/home/marktest:/usr/bin/csh

When I log directly intp the account with ssh, the value of $SHELL is:

SHELL=/usr/bin/csh

When I su - marktest from root, the $SHELL is:

SHELL=/sbin/sh

This is not happening on any other systems. For some reason, issuing a simple su - always sets the $SHELL to /sbin/sh eventhough the passwd entry is for usr/bin/csh.

I even removed /etc/profile, /etc/csh.login and ALL the hidden files from the users $HOME directory (i.e. .profile, .login, .cshrc)

I need to get the $SHELL environment variable to display the correct shell because a product we are using makes a check for this on it's startup script. Also, it appears from the prompt and the fact that the export command does not work, that I am truely in the csh shell even when I use su - marktest. So it just looks like an environment variable issue. Any ideas what could be setting it?

4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: su - does not change $SHELL

Hi Mark:

You don't say what release you are running. If this is 11.11, there is a defect in 'su' that is repaired with patch PHCO_33568.

If you lack the patch, I suggest you download it from the ITRC Patch Database and install it. No reboot is required.

Regards!

...JRF...
Mark Fisher_4
Frequent Advisor

Re: su - does not change $SHELL

Hum, I'm pretty sure I'm running BL 11.23

root@cdtsv1:/uname -a
HP-UX cdtsv1 B.11.23 U ia64 1970548579 unlimited-user license


Does not look like this patch applies to 11.23. So I wonder if it was actually fixed in 11.23 or not.
James R. Ferguson
Acclaimed Contributor

Re: su - does not change $SHELL

Hi (again) Mark:

Yes, you are running 11.23. Use PHCO_33567, instead.

Regards!

...JRF...
Mark Fisher_4
Frequent Advisor

Re: su - does not change $SHELL

Thank you, thank you!!! This did the trick!!!