NetBSD-Users archive

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

Re: OT: User-friendly /bin/sh



On Fri, 31 Jul 2020 at 19:58, Bob Bernstein <poobah%ruptured-duck.com@localhost> wrote:
>
> *** Mandatory Trigger Warning /begin ***
> Brain-dead noobie post dead ahead!
> *** Mandatory Trigger Warning /end ***
>
> I have learned the hard way not to mess with the shell superuser
> is supposed to use. I rarely go to su, but it would be pleasing
> if, when I do, I had two features available from the shell:
> filename completion, and some sort of command history and
> recall.
>
> Can some Good Samaritan please point me to a HOW-TO that would
> provide the needed basic instructions?

You want ksh, both as user and as root.

This is my .shrc as standard user but you can use it and adapt it to root:


# $NetBSD: dot.shrc,v 1.3 2007/11/24 11:14:42 pavel Exp $

if [ -f /etc/shrc ]; then
. /etc/shrc
fi

case "$-" in *i*)
# interactive mode settings go here
;;
esac

# if running ksh
if [ -n "$KSH_VERSION" ]; then
    # include .kshrc if it exists
    if [ -f "$HOME/.kshrc" ]; then
. "$HOME/.kshrc"
    fi
fi




And my .kshrc :


export HISTFILE=$HOME/.ksh.history
export HISTSIZE=1000
PS1='$(whoami)@$(hostname):$PWD$ '
export PAGER="less"
export LESS="-i -m +Gg"
export TERM=xterm



-- 
Ottavio Caruso


Home | Main Index | Thread Index | Old Index