/etc/profile.d scripts

Ray Abbitt rabbitt+rh at abbitt.org
Fri Apr 24 18:17:18 UTC 2009


On Fri, 24 Apr 2009, Dave Martini wrote:

> I have user logging into a RHEL4 box that has a default shell of C Shell.
>
> I have a script in /etc/profile.d that is a Bash shell script with a .sh 
> extension.
>
> Is there a way to have the users shell switched to bash shell when they log 
> into this RHEL4 box so that this particular .sh script in /etc/profile.d can 
> be sourced?

Specify the shell to be used in the script. Make the first line of 
your script:

#!/bin/bash

There may already be a line specifying another shell. If so, delete 
it. Make sure to substitute the proper path if bash is not in /bin.
Also note that the .sh extension is not really needed.

-ray




More information about the redhat-list mailing list