NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: /bin/sh command history in NetBSD/i386



    Date:        Wed, 1 Feb 2017 19:55:54 +0100 (CET)
    From:        Marco Beishuizen <mbeis%xs4all.nl@localhost>
    Message-ID:  <alpine.BSF.2.20.1702011946390.8014@localhost>

  | "set -o emacs" is in my .shrc, so I thought this would do the trick.

Can you confirm that if you actually type that in the sh then editing
works as it should ?

This will allow us to concentrate upon solving the real problem,
and forget about arrow key mappings, and such ...

  | Hey, this does something! So it looks like my .shrc isn't read at all. 

That seems likely.

  | There is a line "export ENV="$HOME/.shrc" in .profile, but that doesn't 
  | seem to be read at startup either.

/etc/profile and .profile are read only in login shells.  By default an xterm
won't start its shell that way - you need the -ls option to the xterm, or
have "xterm*loginShell: true" in your X resources.

Perdonally I just forget .profile, and have ENV set before the xterrm gets
started, and in the environment, so it just gets passed down to the shell.

  | So how to get .shrc and .profile to be read at login?

How are you actually connecting/logging in ?

If you're on the console, and logging in on either /dev/console or
/dev/ttyE? then the getty that does the login sequence, via login, should
make the shell that gets started that way a login shell, and the profile
files will be read.

If you're using a display managed (xdm or similar) then you'll need to
arrange to either set ENV in its config file (somehow) or set up the
default resources so that the loginShell resource gets set (xterms don't
have a menu entry for this one - it would be useless, the shell gets
started before you would get a chance to use it).

If you're using ssh I think starting a login shell should be the default,
and .profile should just get read ... if you're not connecting that way,
perhaps enable sshd and try it, and see if things work then.

kre



Home | Main Index | Thread Index | Old Index