Computing.Net > Forums > Solaris > initializing .profile in korn shell ?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

initializing .profile in korn shell ?

Reply to Message Icon

Name: iraja
Date: January 1, 2002 at 19:51:50 Pacific
Comment:

Hi every one,
which files are read automatically in KORN shell,when we open a termninal window...like in cshell..these files are .cshrc and .login. but wht abt korn shell ?..i wrote a script in .profile which is supposed to be executed everytime we open up a terminal window ..but it doesnot works ( this is new user so i created a .profile fm scratch fr this one)..the profile in /etc/profile does get executed when i move the .profile in user account. and even when i initialize .profile manually it works fine with following command.
->. ./.profile
but its not getting executed automatically whenever we open a terminal window ?



Sponsored Link
Ads by Google

Response Number 1
Name: Mark M
Date: January 3, 2002 at 04:06:12 Pacific
Reply:

As far as I was aware, KSH uses .profile but also .kshrc if you make one.. perhaps you could try .kshrc and see if it makes any difference? :)



0

Response Number 2
Name: Eddie
Date: January 5, 2002 at 03:28:12 Pacific
Reply:

.profile is more for setting system variables than for writing scripts. The correct way to run scripts on login is different from csh.

~/.profile is run once upon login. This should contain a variable called ENV. The filename contained in ENV will be run next.

By convention, ENV is defined to contain ~/.kshrc

The .kshrc file is executed every time a ksh is started within the login session. This is a better file to put your script into.

Also, there is /etc/profile, which is run system wide.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Solaris Forum Home


Sponsored links

Ads by Google


Results for: initializing .profile in korn shell ?

redirect to web page in korn shell www.computing.net/answers/solaris/redirect-to-web-page-in-korn-shell/3691.html

Read a file in Korn Shell www.computing.net/answers/solaris/read-a-file-in-korn-shell/3241.html

Korn shell for login to openSSH www.computing.net/answers/solaris/korn-shell-for-login-to-openssh/3122.html