From owner-freebsd-questions Tue Aug 8 21:10:36 2000 Delivered-To: freebsd-questions@freebsd.org Received: from w2xo.pgh.pa.us (ipl-229-002.npt-sdsl.stargate.net [208.223.229.2]) by hub.freebsd.org (Postfix) with ESMTP id 5548C37BDF7 for ; Tue, 8 Aug 2000 21:10:32 -0700 (PDT) (envelope-from durham@w2xo.pgh.pa.us) Received: from w2xo.pgh.pa.us (shazam.w2xo.pgh.pa.us [192.168.5.3]) by w2xo.pgh.pa.us (8.9.3/8.9.3) with ESMTP id EAA93397; Wed, 9 Aug 2000 04:10:19 GMT (envelope-from durham@w2xo.pgh.pa.us) Message-ID: <3990D9DB.B53B08CA@w2xo.pgh.pa.us> Date: Wed, 09 Aug 2000 00:11:07 -0400 From: Jim Durham Organization: dis- X-Mailer: Mozilla 4.73 [en] (X11; I; FreeBSD 4.1-RC i386) X-Accept-Language: en MIME-Version: 1.0 To: Don Read Cc: FreeBSD Questions Subject: Re: sh's "emacs" mode lost on su References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 > > > > # 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