svn commit: r234978 - in stable/9: etc/mtree etc/root share/examples share/examples/csh share/skel

Eitan Adler eadler at FreeBSD.org
Thu May 3 19:55:37 UTC 2012


Author: eadler
Date: Thu May  3 19:55:36 2012
New Revision: 234978
URL: http://svn.freebsd.org/changeset/base/234978

Log:
  MFC r233429,r233435,r233437,r234077,r234133,r234135,r234159,r234823:
  	A variety of changes that make the default shell easier to use.
  
  Approved by:	cperciva (implicit)

Added:
  stable/9/share/examples/csh/
     - copied from r233429, head/share/examples/csh/
Modified:
  stable/9/etc/mtree/BSD.usr.dist
  stable/9/etc/root/dot.cshrc
  stable/9/share/examples/Makefile
  stable/9/share/examples/csh/dot.cshrc
  stable/9/share/skel/dot.cshrc
Directory Properties:
  stable/9/etc/   (props changed)
  stable/9/share/examples/   (props changed)
  stable/9/share/skel/   (props changed)

Modified: stable/9/etc/mtree/BSD.usr.dist
==============================================================================
--- stable/9/etc/mtree/BSD.usr.dist	Thu May  3 18:12:01 2012	(r234977)
+++ stable/9/etc/mtree/BSD.usr.dist	Thu May  3 19:55:36 2012	(r234978)
@@ -209,6 +209,8 @@
             ..
             bootforth
             ..
+	    csh
+	    	..
             cvs
                 contrib
                 ..

Modified: stable/9/etc/root/dot.cshrc
==============================================================================
--- stable/9/etc/root/dot.cshrc	Thu May  3 18:12:01 2012	(r234977)
+++ stable/9/etc/root/dot.cshrc	Thu May  3 19:55:36 2012	(r234978)
@@ -3,13 +3,14 @@
 # .cshrc - csh resource script, read at beginning of execution by each shell
 #
 # see also csh(1), environ(7).
+# more examples available at /usr/share/examples/csh/
 #
 
 alias h		history 25
 alias j		jobs -l
-alias la	ls -a
+alias la	ls -aF
 alias lf	ls -FA
-alias ll	ls -lA
+alias ll	ls -lAF
 
 # A righteous umask
 umask 22
@@ -17,19 +18,29 @@ umask 22
 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
 
 setenv	EDITOR	vi
-setenv	PAGER	more
+setenv	PAGER	less
 setenv	BLOCKSIZE	K
 
 if ($?prompt) then
 	# An interactive shell -- set some stuff up
-	set prompt = "`/bin/hostname -s`# "
+	if ($uid == 0) then
+		set user = root
+	endif
+	set prompt = "%n@%m:%/ %# "
+	set promptchars = "%#"
+
 	set filec
-	set history = 100
-	set savehist = 100
+	set history = 1000
+	set savehist = (1000 merge)
+	set autolist = ambiguous
+	# Use history to aid expansion
+	set autoexpand
+	set autorehash
 	set mail = (/var/mail/$USER)
 	if ( $?tcsh ) then
 		bindkey "^W" backward-delete-word
 		bindkey -k up history-search-backward
 		bindkey -k down history-search-forward
 	endif
+
 endif

Modified: stable/9/share/examples/Makefile
==============================================================================
--- stable/9/share/examples/Makefile	Thu May  3 18:12:01 2012	(r234977)
+++ stable/9/share/examples/Makefile	Thu May  3 19:55:36 2012	(r234978)
@@ -8,6 +8,7 @@ LDIRS=	BSD_daemon \
 	FreeBSD_version \
 	IPv6 \
 	bootforth \
+	csh \
 	cvsup \
 	diskless \
 	drivers \
@@ -49,6 +50,7 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
 	bootforth/menu.4th \
 	bootforth/menuconf.4th \
 	bootforth/screen.4th \
+	csh/dot.cshrc \
 	cvsup/README \
 	cvsup/cvs-supfile \
 	cvsup/doc-supfile \

Modified: stable/9/share/examples/csh/dot.cshrc
==============================================================================
--- head/share/examples/csh/dot.cshrc	Sat Mar 24 18:43:18 2012	(r233429)
+++ stable/9/share/examples/csh/dot.cshrc	Thu May  3 19:55:36 2012	(r234978)
@@ -21,19 +21,20 @@ bindkey "^[[3~" delete-char-or-list-or-e
 # Make the Ins key work
 bindkey "\e[2~" overwrite-mode 
 
+# Aliases used for completions
+alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1'
+alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*'
+
 # Some common completions
 complete chown          'p/1/u/'
-complete man            'C/*/c/'
-complete service        'n/*/`service -l`/'
-complete service  	'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar onestart onestop)/'
+complete dd		'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/='
+complete kill		'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/'
+complete killall	'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/'
 complete kldunload	'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name` @'
 complete make           'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@'
+complete man            'C/*/c/'
 complete pkg_delete     'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@'
-complete pkg_info       'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed svar/db/pkg/%%`@"
-complete kill		'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/'
-complete killall	'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/'
-alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1A
-alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*'
+complete pkg_info       'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed s%/var/db/pkg/%%`@'
 complete portmaster   'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles \
     clean-packages delete-build-only delete-packages force-config help \
     index index-first index-only list-origins local-packagedir no-confirm \
@@ -41,6 +42,8 @@ complete portmaster   'c/--/(always-fetc
     packages-local packages-only show-work update-if-newer version)/' \
     'c/-/(a b B C d D e f F g G h H i l L m n o p r R s t u v w x)/' \
     'n@*@`_PKGS_PkGs_PoRtS_`@'
+complete service  	'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar onestart onestop)/'
+complete sysctl 'n/*/`sysctl -Na`/'
 
 # Alternate prompts
 set prompt = '#'
@@ -56,5 +59,8 @@ set ellipsis
 alias ll	ls -lAhG
 alias ls	ls -G
 
+# Color on many system utilities
+setenv CLICOLOR 1
+
 # other autolist options
 set		autolist = TAB

Modified: stable/9/share/skel/dot.cshrc
==============================================================================
--- stable/9/share/skel/dot.cshrc	Thu May  3 18:12:01 2012	(r234977)
+++ stable/9/share/skel/dot.cshrc	Thu May  3 19:55:36 2012	(r234978)
@@ -3,13 +3,14 @@
 # .cshrc - csh resource script, read at beginning of execution by each shell
 #
 # see also csh(1), environ(7).
+# more examples available at /usr/share/examples/csh/
 #
 
 alias h		history 25
 alias j		jobs -l
-alias la	ls -a
+alias la	ls -aF
 alias lf	ls -FA
-alias ll	ls -lA
+alias ll	ls -lAF
 
 # A righteous umask
 umask 22
@@ -17,18 +18,29 @@ umask 22
 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
 
 setenv	EDITOR	vi
-setenv	PAGER	more
+setenv	PAGER	less
 setenv	BLOCKSIZE	K
 
 if ($?prompt) then
 	# An interactive shell -- set some stuff up
+	if ($uid == 0) then
+		set user = root
+	endif
+	set prompt = "%n@%m:%/ %# "
+	set promptchars = "%#"
+
 	set filec
-	set history = 100
-	set savehist = 100
+	set history = 1000
+	set savehist = (1000 merge)
+	set autolist = ambiguous
+	# Use history to aid expansion
+	set autoexpand
+	set autorehash
 	set mail = (/var/mail/$USER)
 	if ( $?tcsh ) then
 		bindkey "^W" backward-delete-word
 		bindkey -k up history-search-backward
 		bindkey -k down history-search-forward
 	endif
+
 endif


More information about the svn-src-stable-9 mailing list