1823943 Members
3708 Online
109667 Solutions
New Discussion юеВ

.kshrc not working

 
SOLVED
Go to solution
Roy Francis
Occasional Contributor

.kshrc not working

I am running HP-UX11i and have a user who want to use korn shell (ksh).

Whenever she logs in the system does not appear to be reading the .kshrc or .profile files, ie none of the aliasas etc work.

All other shells work okay and ksh works on solaris okay.

Can someone save me some time?

Thanks
10 REPLIES 10
Michael Schulte zur Sur
Honored Contributor

Re: .kshrc not working

Hi,

check, if the user has ksh assigned in /etc/passwd. Any error messages? Check permissions on .profile and .kshrc
When logged in, try . $HOME/.profile

greetings,

Michael
Umapathy S
Honored Contributor
Solution

Re: .kshrc not working

Check if the user is logging via CDE.
The last line should be uncommented in .dtprofile to make the .profile readable.
DTSOURCEPROFILE=true

If it still persists then it the problem with the terminal they are opening.

echo "*loginShell:true" >/.Xdefaults
Arise Awake and Stop NOT till the goal is Reached!
Denver Osborn
Honored Contributor

Re: .kshrc not working

listen the the suggestions above and...

try to "su - username" and verify that the .kshrc or .profile isn't being used. Also look at the user's .profile to see if ENV is exported and what it's exported to (ie/ ENV=.kshrc)

If you are able to su to the user and see it parses each file as expected, then it may be they're using CDE and the .dtprofile does not have "DTSOURCEPROFILE=true". Adding this to the .dtprofile will fix it so your users .profile is read when logging into cde.

hope this helps,
-denver
Chris Wilshaw
Honored Contributor

Re: .kshrc not working

.kshrc is not used as a default.

ksh uses .profile

If you wish users to execute .kshrc when the log in, the line

export ENV=$HOME/.kshrc

should be added to /etc/profile. This will allow user customisations to be added to the .kshrc file in their home directory.
Dave La Mar
Honored Contributor

Re: .kshrc not working

Roy -
As others have stated ....
See below for what we do to accomplish this in our environment-
From .profile

# Set up the shell variables:
EDITOR=vi
export ENV=~/.kshrc

From .dtprofile

#
# If $HOME/.profile (.login) has been edited as described above, uncomment
# the following line.
#
DTSOURCEPROFILE=true

Best regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Roy Francis
Occasional Contributor

Re: .kshrc not working

Thanks for the replies.

DTSOURCEPROFILE is uncommented
ENV is set
permissions 644 (Ihave also tried 755)

Neither .profile or .kshrc seem to be run.

Any other ideas?
Umapathy S
Honored Contributor

Re: .kshrc not working

Jose,

Did you try this?
echo "*loginShell:true" >$HOME/.Xdefaults

This will work.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Umapathy S
Honored Contributor

Re: .kshrc not working

Roy, sorry for addressing incorrectly.
Arise Awake and Stop NOT till the goal is Reached!
Mark Greene_1
Honored Contributor

Re: .kshrc not working

If you are connecting via exceed or other emulator, you need to include the -ls option on the xterm command to get it to run the .profile.

mark
the future will be a lot like now, only later
Roy Francis
Occasional Contributor

Re: .kshrc not working

All

The suggestion by Umapathy worked and solved the problem.

I used echo "*loginShell:true" > $HOME/.Xdefaults as suggested.

Thank you all for your responses.