Hi Chet,

Can I suggest `help .` and `help source` mention they don't search PATH if
`shopt -u sourcepath` is in effect?

I just lost several hours re-discovering that. The shopt had been in my .bashrc
since forever and I had forgotten about it.

If you do like the idea, you could maybe start from the attached patch.

Cheers ... Duncan.
diff --git a/builtins/source.def b/builtins/source.def
index 41c664f9..edf54f8f 100644
--- a/builtins/source.def
+++ b/builtins/source.def
@@ -28,8 +28,9 @@ Execute commands from a file in the current shell.
 Read and execute commands from FILENAME in the current shell. If the
 -p option is supplied, the PATH argument is treated as a colon-
 separated list of directories to search for FILENAME. If -p is not
-supplied, $PATH is searched to find FILENAME. If any ARGUMENTS are
-supplied, they become the positional parameters when FILENAME is executed.
+supplied, $PATH is searched to find FILENAME unless `shopt -u sourcepath'
+is asserted. If any ARGUMENTS are supplied, they become the positional
+parameters when FILENAME is executed.
 
 Exit Status:
 Returns the status of the last command executed in FILENAME; fails if
@@ -45,8 +46,9 @@ Execute commands from a file in the current shell.
 Read and execute commands from FILENAME in the current shell. If the
 -p option is supplied, the PATH argument is treated as a colon-
 separated list of directories to search for FILENAME. If -p is not
-supplied, $PATH is searched to find FILENAME. If any ARGUMENTS are
-supplied, they become the positional parameters when FILENAME is executed.
+supplied, $PATH is searched to find FILENAME unless `shopt -u sourcepath'
+is asserted. If any ARGUMENTS are supplied, they become the positional
+parameters when FILENAME is executed.
 
 Exit Status:
 Returns the status of the last command executed in FILENAME; fails if

Reply via email to