Obviously in your example
.profile won't be sourced until you exit
ksh. That's the way shell works.
I tried to do on my local machine the following:
$ cat /home/test/.profile
$ cat ~/.kshrc
echo "commands you need in ksh"
As profile is read only once on a login, it seems to be working. Whenever I login as a user, I've
ksh as a shell. Didn't check it with
PID TTY TIME CMD
9667 pts/1 00:00:00 ksh
9675 pts/1 00:00:00 ps
Note, that I use
exec ksh over simple invoke
ksh, so you'll have just
ksh which replaced
bash instead of
ksh running as a child of
In any way, I advise to ask sysadmin or whoever has the grant to update the settings in /etc/passwd to do so. It might help you to avoid unexpected issues with inheritance of some settings from bash you might not face when you directly invoke ksh.