cgray1223
asked on
Shell Script Command to Determine User Shell
Hello,
I need to write a shell script to set some environment variables. My current version of the script is setup for the bash unix/linux profile. How can I make the shell script dynamically figure out what shell is currently being used so that I can apply the appropriate environment variable commands?
ANT_HOME=/auto/energywise/ apache-ant -1.8.2
export ANT_HOME
I need to write a shell script to set some environment variables. My current version of the script is setup for the bash unix/linux profile. How can I make the shell script dynamically figure out what shell is currently being used so that I can apply the appropriate environment variable commands?
ANT_HOME=/auto/energywise/
export ANT_HOME
Actually, you might like : ps ef | grep $$ | awk '{print $11}', I'm sure you can find something you like playing around with ps and awk.
echo $SHELL will do in most cases.
grep `whoami` /etc/passwd | awk -F: '{print NF}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ps -ef | grep $$ | awk '{print $8}'