set -o emacs in .profile,.kshrc,.login but still not working

set -o emacs in .profile,.kshrc,.login but still not working

Post by deja_tony_.. » Fri, 19 Sep 2003 12:36:53



Hi

My default shell is set to ksh.  I want to run ksh with

set -o emacs

I have placed this in my .profile, .kshrc and .login files in my home
directory, but ksh always starts up in vi mode.  What am I doing
wrong?

Cheers

Tony

 
 
 

set -o emacs in .profile,.kshrc,.login but still not working

Post by Villy Kru » Fri, 19 Sep 2003 17:35:27


On 17 Sep 2003 20:36:53 -0700,

Quote:>Hi

>My default shell is set to ksh.  I want to run ksh with

>set -o emacs

>I have placed this in my .profile, .kshrc and .login files in my home
>directory, but ksh always starts up in vi mode.  What am I doing
>wrong?

It is easier to set and export the VISUAL=emacs variable in your
.profile or perhaps /etc/profile if you want to do that systemwide.

Villy

 
 
 

set -o emacs in .profile,.kshrc,.login but still not working

Post by Ed Morto » Fri, 19 Sep 2003 19:30:09



> Hi

> My default shell is set to ksh.  I want to run ksh with

> set -o emacs

> I have placed this in my .profile, .kshrc and .login files in my home
> directory, but ksh always starts up in vi mode.  What am I doing
> wrong?

Usign emacs 8-). Sorry, couldn't resist. Try just doing:

export VISUAL=emacs

in your .profile.

        Ed.

 
 
 

set -o emacs in .profile,.kshrc,.login but still not working

Post by Andreas Kahar » Fri, 19 Sep 2003 22:00:51



> Hi

> My default shell is set to ksh.  I want to run ksh with

> set -o emacs

> I have placed this in my .profile, .kshrc and .login files in my home
> directory, but ksh always starts up in vi mode.  What am I doing
> wrong?

KornShell doesn't care about ~/.login, and only cares about
~/.kshrc if you've said "export ENV=~/.kshrc" in your ~/.profile
(or if you parse it explicitly with ". ~/.kshrc" in ~/.profile).

See question 8.16 "ksh(1) does not appear to read my .profile!"
of the OpenBSD FAQ here:

    http://www.openbsd.org/faq/faq8.html#ksh

It might possibly answer your question.

--
Andreas K?h?ri

 
 
 

set -o emacs in .profile,.kshrc,.login but still not working

Post by Dan Merce » Fri, 19 Sep 2003 23:47:28


: Hi
:
: My default shell is set to ksh.  I want to run ksh with
:
: set -o emacs
:
: I have placed this in my .profile, .kshrc and .login files in my home
: directory, but ksh always starts up in vi mode.  What am I doing
: wrong?
:
: Cheers
:
: Tony

You don't tell us what environment you are running in,  but I'll guess
you are popping up an xterm,  dtterm or something similar.  X11
window terminal emulators are not started as login shells by default,
because you are already logged in through X.  Only login shells read
.profile.  There are many ways of getting around this,  but without
knowing your particulars,  I can't advise.

Dan Mercer

 
 
 

set -o emacs in .profile,.kshrc,.login but still not working

Post by Ralf Bensman » Sun, 21 Sep 2003 02:32:46



> Hi

> My default shell is set to ksh.  I want to run ksh with

> set -o emacs

> I have placed this in my .profile, .kshrc and .login files in my home
> directory, but ksh always starts up in vi mode.  What am I doing
> wrong?

> Cheers

> Tony

Try

set -o gmacs (yes, a 'g' instead of 'e')

Cheers,
Ralf

 
 
 

set -o emacs in .profile,.kshrc,.login but still not working

Post by Andreas Kahar » Sun, 21 Sep 2003 02:47:29




>> My default shell is set to ksh.  I want to run ksh with

>> set -o emacs

>> I have placed this in my .profile, .kshrc and .login files in my home
>> directory, but ksh always starts up in vi mode.  What am I doing
>> wrong?
[cut]

> Try

> set -o gmacs (yes, a 'g' instead of 'e')

If the file isn't parsed, that's not going to make any
difference.  And all KornShells that I'm aware of supports all
three diffreerent command line editor modes (vi, emacs, gmacs),
so if emacs isn't working, then so won't gmacs.

See the other solutions given in this thread.

--
Andreas K?h?ri

 
 
 

set -o emacs in .profile,.kshrc,.login but still not working

Post by Ralf Bensman » Sun, 21 Sep 2003 02:58:53





>>>My default shell is set to ksh.  I want to run ksh with

>>>set -o emacs

>>>I have placed this in my .profile, .kshrc and .login files in my home
>>>directory, but ksh always starts up in vi mode.  What am I doing
>>>wrong?

> [cut]

>>Try

>>set -o gmacs (yes, a 'g' instead of 'e')

> If the file isn't parsed, that's not going to make any
> difference.  And all KornShells that I'm aware of supports all
> three diffreerent command line editor modes (vi, emacs, gmacs),
> so if emacs isn't working, then so won't gmacs.

> See the other solutions given in this thread.

I placed that in ~/.kshrc and it works for me. There are no settings
in /etc/profile like ENV=~/.kshrc (its the default) nor VISUAL=emacs.
I use Solaris 9.
 
 
 

1. Proper use of .login/.cshrc (and .profile/.kshrc)

This is probably FAQ and I've seen many of the answers to this before,
but, everytime I start a new job, I wind up reassessing the answer...

The question of what to put in the initialization files of shells has
long been a thorn in my side.  The basic shells (CSH and KSH) each
have an init file that is run at login time (.login/.profile) and an
init file that is run each time a shell is started (.cshrc/.kshrc).
The design seems to suggest that environment variables and terminal
capabilities are initialized in the login init files while aliases
(and the like) are initialized in the shell init files.  This I
basically agree with, but (AFAIK) almost all users seem to lump the
two things into the shell init files (well, terminal setup *usually*
stays in the login init files).

As I said, I tend toward the belief that environment variables should
be initialized in ~/.login or ~/.profile.  To me, this has the
following benefits:

* No strange "gotchas" due to setting an environment variable at the
  command line and having it overridden by ~/.cshrc behind your back
  (I've seen this bite even experienced CShell users).

* Quicker startup of shells due to not having to reparse a large stack
  of environment variable setups that are (most likely) already in the
  environment.

However, this also seems to have the following problems:

* Since ~/.cshrc runs before ~/.login, the ~/.cshrc file cannot be
  dependent on the setup of the environment variables (this is not a
  problem with .profile/.kshrc in KShell because the order is
  reversed).

* Since the login init files are not run by remote shell type
  commands, your environment will not be completely setup (this is
  always a problem with KShell type shells as they do not default to
  reading .kshrc).

So, I'm curious and thought I'd poll the group on how they handle
this:

* What is your login shell?
* Where do you keep your environment variable initializations?
* How do you handle the remote shell issue above?
* How do you allow for resetting env. vars, at the command line?

--
David Masterson
Sr. R&D Engineer
Synopsys, Inc.

2. MORE ppp channels (not)

3. : Re: root login / kshrc not read

4. Dates

5. set-fill-column not working on emacs

6. Modem Set-up Problems/Can't Mount CD-ROM

7. root login / kshrc not read

8. LILO Error?

9. *PATH settings should go in .profile or .kshrc?

10. Re. AIX .profile & .kshrc

11. Correct usage of .profile vs. .kshrc debate

12. .kshrc & .profile

13. ?: OW 3.3/Shelltool/ksh IGNORING .profile/.kshrc??