Results 1 to 5 of 5
Hi,
I have a small question about the ksh. My default shell is configured to sh by the administrator. But I prefer to use ksh. So I add the following ...
- 09-03-2008 #1Just Joined!
- Join Date
- Sep 2008
- Posts
- 3
how to let ksh run a script without existing itself?
Hi,
I have a small question about the ksh. My default shell is configured to sh by the administrator. But I prefer to use ksh. So I add the following lines into my .profile (which will be ran automatically by sh).
set -o vi
ksh
But unluckliy the sh doesn't recognize "set -o vi". And if I remove the line, my ksh won't have the related functionality. I also tried to find a way to let the ksh run another script, but it doesn't work. When the script is finished, ksh will exit.
Any ideas?
Thanks,
Daniel
- 09-03-2008 #2Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
I can't help directly because I don't know anything about ksh. But I suggest reading the ksh man page to know what the ksh rc files are, and/or how would you go about specifying the rc file on command line.
All the commands that must take effect under ksh should be on the ksh rc files, and not in ~/.profile, which is a bash init file. Once you launch ksh from the bash init file, then the ksh rc files should be read.
- 09-03-2008 #3Just Joined!
- Join Date
- Sep 2008
- Posts
- 3
Thank you so much. I've found out how to figure this out.
The solution is simply like this:
In my .profile which is executed by sh,
export ENV
ENV="$HOME/.env"
ksh
Then in file $HOME/.env,
set -o vi
And that's all. It appears $ENV is automatically executed when ksh is invoked.
Thanks a lot for your help.
Regards,
Daniel
- 09-03-2008 #4Linux User
- Join Date
- Jun 2007
- Posts
- 318
Can't you use chsh to change your login shell?
$ chsh
Changing shell for <user>.
Password:
New shell [/bin/bash]: /bin/ksh
- 09-04-2008 #5Just Joined!
- Join Date
- Sep 2008
- Posts
- 3
Thank you. It works! I've changed my shell to ksh with chsh.
I thought only administrator can change my login shell.


Reply With Quote
