SOURCES: bashrc - skip bashrc processing very early for non-intera...

glen glen at pld-linux.org
Fri Dec 30 01:34:08 CET 2005


Author: glen                         Date: Fri Dec 30 00:34:08 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- skip bashrc processing very early for non-interactive shells

---- Files affected:
SOURCES:
   bashrc (1.28 -> 1.29) 

---- Diffs:

================================================================
Index: SOURCES/bashrc
diff -u SOURCES/bashrc:1.28 SOURCES/bashrc:1.29
--- SOURCES/bashrc:1.28	Mon Sep 19 17:00:02 2005
+++ SOURCES/bashrc	Fri Dec 30 01:34:02 2005
@@ -3,6 +3,14 @@
 # System wide functions and aliases
 # Environment stuff goes in /etc/profile
 
+# Test for an interactive shell.  There is no need to set anything
+# past this point for scp and rcp, and it's important to refrain from
+# outputting anything in those cases.
+if [[ $- != *i* ]] ; then
+	# Shell is non-interactive.  Be done now!
+	return
+fi
+
 # If this is an xterm set the title to user at host:dir
 case $TERM in
 	gnome|nxterm|xterm*|rxvt*)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/bashrc?r1=1.28&r2=1.29&f=u



More information about the pld-cvs-commit mailing list