Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Aug 2000 00:11:07 -0400
From:      Jim Durham <durham@w2xo.pgh.pa.us>
To:        Don Read <dread@texas.net>
Cc:        FreeBSD Questions <FreeBSD-questions@FreeBSD.ORG>
Subject:   Re: sh's "emacs" mode lost on su
Message-ID:  <3990D9DB.B53B08CA@w2xo.pgh.pa.us>
References:  <XFMail.000808212139.dread@texas.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Don Read wrote:
> 
> 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


Duh.... How'd I miss that? It's right at the top.

Thanks!
-- 
Jim Durham


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?3990D9DB.B53B08CA>