Discussion Locked

Korn Shell - .profile (Xwindows)

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Help please! I defined some aliases in my .profile, but they don't work when I first login. I have to recompile .profile in order to get them work. Have any idea of how to fix this?

7 replies

by jay eckles

First of all, you don't "compile" .profile - it's just a kshell scrpt - it's interpreted.

You don't provide any snippets of your .profile, but here's a line that correctly defines an alias:

alias db="mysql -uusername -p databasename"

Put this line in your .profile, save the file, log out, and log back in. Now you should be able to type "db" instead of the long command to launch the mysql client.

Please tell us what is not working, give us an example alias line from your .profile that isn't working (and an example of one that is working, if any are).

Good luck.

Jay Eckles
www.jayeckles.com

by elingy

I know how to define an alias. The problem I have is the .profile doesn't compile correctly at login. None of my alias work when I login. But after I recompile the file (. .profile), then my alias are working fine.

by gary_w

what's happening is ".profile" does not get run if you are logging in with the Korn shell. Move your alias settings to ".kshrc" instead.

They work after running ". .profile" because this commnad runs the .profile file in the current shell, thus setting your aliases.

Note also the you are not compiling these file but simply running them in the current shell.

Blue Skies,
Gary

by elingy

Besides the aliases, all other things within the .profile works properly, such as the PATH variable setting. I tried using .kshrc to store all my aliases already. It still didn't work. The .kshrc file did not compile automatically during login either. I have to comiple it (. .kshrc) after login in order to get my aliases to work. Any other suggestion?

This discussion is closed to new replies.