Bug 3740 - use ENV file for sh(1)
Summary: use ENV file for sh(1)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 3.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-06-01 19:50 UTC by Helbig
Modified: 1997-08-17 22:34 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helbig 1997-06-01 19:50:01 UTC
        The default .profile file defines some very useful aliases
	and shell flags like -o emacs. But these settings are effective
	for login shells only, i. e. after su(1) or starting the shell in
	an xterm(1), you'll have to reenter the environment. So I suggest
	to use the ENV feature of the shell.
	In the Fix section you'll find a diff for the dot.profile and a
	new file dot.shrc.

Fix: 

---------------- here comes dot.shrc ---------------------------------------
#
# .shrc - ENV file for /bin/sh
#
# This file will be used if the shell is invoked for interactive use and
# the environment variable ENV is set to this file.
#
# see also sh(1), environ(7).
#	$Id$
#


# 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


# some useful aliases
alias h='fc -l'
alias j=jobs
alias m=$PAGER
alias ll='ls -laFo'
alias l='ls -l'
alias g='egrep -i'
 
# # be paranoid
# alias cp='cp -ip'
# alias mv='mv -i'
# alias rm='rm -i'

# # set prompt: ``username@hostname$ '' 
# PS1="`whoami`@`hostname | sed 's/\..*//'`"
# case `id -u` in
# 	0) PS1="${PS1}# ";;
# 	*) PS1="${PS1}$ ";;
# esac

# search path for cd(1)
# CDPATH=.:$HOME--IEWNQ1k1CI0a9xx5yIOBHlwyJH3pk7xNlnnMfGm34kZXyVhp
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

Index: dot.profile
===================================================================
RCS file: /usr/cvsroot/src/share/skel/dot.profile,v
retrieving revision 1.11
diff -c -r1.11 dot.profile
*** dot.profile	1997/03/08 16:35:39	1.11
--- dot.profile	1997/06/01 18:24:31
***************
*** 22,56 ****
  #
  # umask	022
  
! # 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
! 
! 
! # some useful aliases
! alias h='fc -l'
! alias j=jobs
! alias m=$PAGER
! alias ll='ls -lagFo'
! alias l='ls -l'
! alias g='egrep -i'
!  
! # # be paranoid
! # alias cp='cp -ip'
! # alias mv='mv -i'
! # alias rm='rm -i'
! 
! 
! # # 8-bit locale (English, USA), to read umlauts in vi(1).
  # LANG=en_US.ISO_8859-1; export LANG
   
! 
! # # set prompt: ``username@hostname$ '' 
! # PS1="`whoami`@`hostname | sed 's/\..*//'`"
! # case `id -u` in
! # 	0) PS1="${PS1}# ";;
! # 	*) PS1="${PS1}$ ";;
! # esac
! 
! # search path for cd(1)
! # CDPATH=.:$HOME
--- 22,29 ----
  #
  # umask	022
  
! # 8-bit locale (English, USA), to read umlauts in vi(1).
  # LANG=en_US.ISO_8859-1; export LANG
   
! # set ENV to a file invoked each time sh is started for interactive use.
! ENV=$HOME/.shrc;	export ENV
Comment 1 helbig 1997-07-27 08:05:54 UTC
I think this enhances the usability of sh(1)--at least for me.
But since no one else seems to even consider it, it should be closed.

Wolfgang
Comment 2 Wolfram Schneider freebsd_committer 1997-07-28 00:10:46 UTC
State Changed
From-To: open->closed

Closed by originator request.