1833899 Members
2082 Online
110063 Solutions
New Discussion

ctrl + c and ksh .....

 
SOLVED
Go to solution
Manuales
Super Advisor

ctrl + c and ksh .....

Hi, i'm using /usr/sbin/sh but i want to use /usr/bin/ksh

i did:
export SHELL=/usr/bin/ksh

how can i do for automatic way this has been changed every time i open a new sesion?

and

i tried to enter ctrl + c but it does not work !!!!!

sh: ^C: not found.

how can i fix that?

please let me know.
Thanks.
7 REPLIES 7
Marco A.
Esteemed Contributor
Solution

Re: ctrl + c and ksh .....

Add that line into your .profile file located at /etc/profile , the in the next login you will load that automatically.

rgds,
Just unplug and plug in again ....
Marco A.
Esteemed Contributor

Re: ctrl + c and ksh .....

sorry .. /etc/.profile
or for root ... /root/.profile


rgds,
Just unplug and plug in again ....
Ivan Krastev
Honored Contributor

Re: ctrl + c and ksh .....

Or just change your shell with usermod:

usermod -s /usr/bin/ksh


regards,
ivan
Patrick Wallek
Honored Contributor

Re: ctrl + c and ksh .....

Well, just setting the SHELL variable does not mean you are actually using ksh now. It just means that the SHELL variable contains /usr/bin/ksh.

To actually use ksh in the current session you can do:

# /usr/bin/ksh
or
# exec /usr/bin/ksh

To always use ksh you can change your default shell in the /etc/passwd file. HOWEVER, NEVER EVER EVER CHANGE ROOT's DEFAULT SHELL. It must ALWAYS be /sbin/sh.

To change your default shell in /etc/passwd you can use the usermod command (see the usermod man page for details) or, if you have permission, you can edit /etc/passwd, preferably with vipw.
Manuales
Super Advisor

Re: ctrl + c and ksh .....

I need that be only for one user ..
and what about ctrl + c, how can i fix that?
y try to use that keys but they do not work ....


:(

please let me know.

Thanks.
A. Clay Stephenson
Acclaimed Contributor

Re: ctrl + c and ksh .....

First on an HP-UX box there is no reason to run the Korn shell. /usr/bin/sh is not the Bourne shell but is rather the POSIX shell and the behavior of the POSIX is all but indistinguishable from that of the Korn shell. The POSIX shell is a superset of the Korn shell.

As for your Ctrl-C question, I am having trouble finding a question. You may want Ctrl-C to be the default interrupt key, if that is the case then insert a line 'stty intr "^C"' in the user's .profile.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: ctrl + c and ksh .....

The simplest way to change your shell is to use chsh -- no root capability required. Like this:

chsh billh /usr/bin/ksh

Your CTRL-C problem is caused by not logging in in a 'normal' manner (for example, using Xwindows), or someone has clobbered your .profile. All HP-UX come with a standard .profile that set CTRL-C (and several other important terminal settings). If someone has 'improved' your .profile by borrowing one from another flavor of Unix, just replace it with the standard version:

cp /usr/newconfig/etc/skel/.profile $HOME/.profile

If you are running Xwindows, then your terminal window is probably bypassing standard login scripts. Change to standard behavior by doing this one time for each user:

echo "*loginShell: true" >> $HOME/.Xdefaults


Bill Hassell, sysadmin