Date: Tue, 08 Aug 2000 21:21:39 -0500 (CDT) From: Don Read <dread@texas.net> To: Jim Durham <durham@w2xo.pgh.pa.us> Cc: FreeBSD Questions <FreeBSD-questions@FreeBSD.ORG> Subject: RE: sh's "emacs" mode lost on su Message-ID: <XFMail.000808212139.dread@texas.net> In-Reply-To: <3990B785.78290DA6@w2xo.pgh.pa.us>
next in thread | previous in thread | raw e-mail | index | archive | help
On 09-Aug-00 Jim Durham wrote:
> I usually run the shell (sh) in emacs mode by specifying "set -o emacs"
> in .profile.
>
> Unfortunately, when one does an "su" to do something as root, the
> emacs mode, being a function of the user shell, does not apply
> to the root shell started by "su". This usually causes me to forget,
> type an emacs command, and stare stupidly at the screen for a moment
> before I remember to do "set -o emacs" in the su'd shell.
>
> "su -" or "su -l" keep emacs mode on, if it is specified in the
> .profile of /root, but cd's one to /root, not what it usually
> wanted either.
>
> After reading the "su" and "sh" man pages, I see no way around this.
>
> Am I overlooking something obvious?
>
a couple a' cups of coffee reading man sh ? ;)
localhost.dread$ grep ENV ~/.profile
# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV
cat $ENV
<big_snip>
# Uncomment next line to enable the builtin emacs(1) command line editor
# in sh(1), e.g. C-a -> beginning-of-line.
set -o emacs
PS1="`hostname | sed 's/\..*//'`.`whoami`"
case `id -u` in
0) PS1="${PS1}# ";;
*) PS1="${PS1}$ ";;
esac
Regards,
--
Don Read dread@texas.net
-- "Stop telling God what to do" - Niels Bohr to A. Einstein
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.000808212139.dread>
