Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Apr 2000 12:06:25 -0700 (PDT)
From:      Doug Barton <Doug@gorean.org>
To:        James Howard <howardjp@wam.umd.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: /bin/sh question
Message-ID:  <Pine.BSF.4.21.0004201200400.83239-300000@dt051n0b.san.rr.com>
In-Reply-To: <200004201611.MAA01664@rac4.wam.umd.edu>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Thu, 20 Apr 2000, James Howard wrote:

> I have been a bash addict for many years.  This is one of two bad habits I
> still have not broken from my days as a Linux admin (please don't tell
> anyone!).  The other is 'less.'
> 
> However, I have recently noticed that FreeBSD's sh does nearly everything
> I need except for one thing.  My bash prompt is set to "\u@\h:\w\$ " and
> typically my prompt is then shown as "howardjp@byzantine:~$ ".  Is there
> anyway to get something similar from sh?  

	Attached are the .profile and .shrc files I submitted to -hackers
(or -current, I don't remember) as candidates for inclusion in the
base. They were created out of a combination of what's already there, and
some things of my own. After much discussion nothing happened with them,
but I still think they are pretty good. :) I use them myself now.

	BTW, there is nothing wrong with using bash, it's been my primary
shell for 7 years. I use /bin/sh as my login shell for both root and my
unprivileged user, and I have the following as the very first line in my
.profile:

[ -x /usr/local/bin/bash ] &&
        exec /usr/local/bin/bash --rcfile $HOME/.bash_profile

Works like a charm.

Doug
-- 
Excess on occasion is exhilarating.  It prevents moderation from
acquiring the deadening effect of a habit.
                -- W. Somerset Maugham

[-- Attachment #2 --]
# $FreeBSD: src/etc/root/dot.profile,v 1.20 1999/08/27 23:24:09 peter Exp $
#
# .profile - Bourne Shell startup script for login shells
#
# see also sh(1), environ(7).
#

# Remove /usr/games and /usr/X11R6/bin if you want
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/games:$HOME/bin
export PATH

# Setting TERM is normally done through /etc/ttys.  Only override
# if you're sure that you'll never log in via telnet, xterm or a
# serial line.
# Use cons25l1 for iso-* fonts
TERM=${TERM:-cons25}
export TERM

EDITOR=vi
export EDITOR
PAGER=more
export PAGER
BLOCKSIZE=K
export BLOCKSIZE

# Set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV


[-- Attachment #3 --]
# $FreeBSD$
#
# .shrc - Bourne shell startup file
#
# This file will be used if the shell is invoked for interactive use and
# the environment variable ENV is set to the name of this file.
#
# See also sh(1), environ(7).
#

# Make interactive shells a little more friendly
set -o emacs

# Search path for cd(1)
CDPATH=.:$HOME

# Prompt
_USERNAME=`whoami`
PS1="$_USERNAME@`hostname -s`"
case "$_USERNAME" in
	root) PS1="${PS1}# " ;;
	*) PS1="${PS1}$ " ;;
esac

# Allows permissions of -rwxr-xr-x
umask 022

# General aliases
alias la='ls -A'
alias lf='ls -AF'
alias ll='ls -loaF'
alias m=$PAGER
alias g='egrep -i'

# Shell specific aliases
alias h='fc -l'
alias j=jobs

# For the paranoid
#alias cp='cp -ip'
#alias mv='mv -i'
#alias rm='rm -i'

# Implement a csh-like unlimit command.  Unpriviliged users may
# not be able to change some of these limits.
unlimit ( ) {
	echo '   Setting sock buf size';	ulimit -b unlimited
	echo '   Setting core file size';	ulimit -c unlimited
	echo '   Setting data size';		ulimit -d unlimited
	echo '   Setting file size';		ulimit -f unlimited
	echo '   Setting locked mem size';	ulimit -l unlimited
	echo '   Setting res size';		ulimit -m unlimited
	echo '   Setting fds';			ulimit -n unlimited
	echo '   Setting stack size';		ulimit -s unlimited
	echo '   Setting cpu time';		ulimit -t unlimited
	echo '   Setting max processes';	ulimit -u unlimited
}

# Uncomment to display a random cookie each login:
#[ -x /usr/games/fortune ] && /usr/games/fortune

help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0004201200400.83239-300000>