I am having an issue setting up an environment on .profile. I want to set up my .profile in that way that everytime I login to the host, it should automatically set up my group. I tried the folllowing but it doesn't work. It is on the solaris OS.
HOSTNAME=$(hostname)
if [[ "$HOSTNAME" = "tpat1a" ]] || [[ "$HOSTNAME" = "tpat2a" ]]
then
newgrp unixteam
umask 002
fi
I am working on ksh. When I inserted that script on my .profile and executed it (. ./.profile), it didn't change my group. I am wondering if there is anything wrong on my script or Does this should be different on unix and linux host? Do I need to modify anything to make it work?
Yes, the group exists. I can use this "newgrp <groupname>" from command line. I have to type it all the time everytime I log in. I want to keep it in my .profile so that I don't have to type it again and again. Most of the time I forgot and it messess up everything.
The hostname is correct. While executing the bash -x .profile there is one error found on:
integer KSHLEVEL=0
.profile: line 167: integer: command not found.
I haven't tried the following command. I am scared if it disable the system login. Any suggestions whether to use it or not.
umask 002exec newgrp unixteam