Changing shell and DISPLAY in .profile based on userid

Changing shell and DISPLAY in .profile based on userid

Post by Lyl » Thu, 23 Oct 2003 01:22:46



Keywords: change shell bashrc .profile unix korn bash DISPLAY

I found this little snippet helpful in my .profile. The goal is to
change the shell from the Korn shell, which everyone else in my group
uses, to the bash shell, which I use, and also, to set my DISPLAY
environment variable (only if its me logging in), and use vi commands
to navigate through the shell history:

In .profile:

loginSourceID=`who am i | awk '{print $1}'`
if [[ $loginSourceID = "myuserid" ]] ; then
        export DISPLAY=myIPAddress:0.0
        cd ~/myregulardir
        export SHELL=/usr/bin/bash
        exec bash
fi

In .bashrc:
set -o vi

 
 
 

Changing shell and DISPLAY in .profile based on userid

Post by Barry Margoli » Thu, 23 Oct 2003 01:48:02




>Keywords: change shell bashrc .profile unix korn bash DISPLAY

>I found this little snippet helpful in my .profile. The goal is to
>change the shell from the Korn shell, which everyone else in my group
>uses, to the bash shell, which I use, and also, to set my DISPLAY
>environment variable (only if its me logging in), and use vi commands
>to navigate through the shell history:

Why do you need to do this?  Each user should have their own .profile.  Are
you all sharing the same $HOME directory for some reason?

--

Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. Change pppd options based on userid

Is it possible to specify the pppd options based on the userid (maybe like
you can specify different options on a per port basis with options.ttyS-)?
I want to be able to specifiy ms-dns options for some dial-in users, but not
specify them for other users.

I use the pap-secrets file for authenication, and the users are not OS
users.  I am running Mandrake 8.1 and the version of pppd that ships with
it.

Thanks!
Ron

2. Slackware w/RPM or Red Hat without

3. Changing userid within the Shell

4. oprofile for ppc

5. how to change userid inside a shell script ?

6. x and screen size/resolution -- is there an answer?

7. changing shell in .profile - CDE login problem

8. Sync hangs on RH 5.0

9. "Screen" prgram: New shells won't read /etc/profile or ~/.profile?

10. changing bash profile into csh profile?

11. Need help: IP routing based on userid

12. rksh shell, how do i stop .profile from loading in restricted shell

13. mod_vhost_alias and documentroot based on unix userid