Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sourcing .profile in korn 1

Status
Not open for further replies.

maunir

MIS
Apr 30, 2002
62
0
0
US
Can someone tell me how to do sourcing once in korn shell. Cause whenever I open up a new terminal, or whenever I login, I have to do a source on .profile everytime. I can't find help anywhere.
 
I have the same issue on my sun boxen.

If I telnet to the machine(s), the .profile is read. (I am a korn shell user)

If I open the terminal from the gui, (ie eXceed/local console) the .profile is not sourced...

I have seen scripts that check to see if the login is via gui, and if so, source the .profile, but haven't been able to locate something decent recently.

If anyone has any ideas please post a reply.

Thanks in advance!
 
Hi,
Make sure that the line

dtsourceprofile=TRUE

in the .dtprofile file in your home directory is uncommented. Otherwise, the .dtprofile is read instead of the .profile.

Hope this helps.
 
Here's another option. We also use the korn shell, but we use the arrow keys on the keyboard to go through the command history.
In the .profile use the following :

set -o emacs
alias __A=`echo "\020"` # up arrow = ^p = back a command
alias __B=`echo "\016"` # down arrow = ^n = down a command
alias __C=`echo "\006"` # right arrow = ^f = forward a character
alias __D=`echo "\002"` # left arrow = ^b = back a character
alias __H=`echo "\001"` # home = ^a = start of line
 
Instead of having the .profile calling .kshsrc why not code everything in the .profile.
My .profile works and I invoke korn shell thus: -
exec /bin/ksh -o vi

Ged Jones

Top man
 
According to O'Reilly's "Unix in a Nutshell", ksh executes both /etc/profile and $HOME/.profile at login. Unlike csh however, there is no file that is executed by default for every new shell. You can however, force it to do so by exporting the variable ENV, set to the name of the file to be executed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top