From: Paul Eggert Date: Tue, 2 Oct 2001 23:32:11 +0000 (+0000) Subject: (Limitations of Builtins): You can't use "source"; it's not portable. X-Git-Tag: AUTOCONF-2.52f~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c75df8b9476ddd57c10fe83f48bbf4ef95fb754f;p=thirdparty%2Fautoconf.git (Limitations of Builtins): You can't use "source"; it's not portable. Remove confusing and somewhat-incorrect example involving "." and "/". --- diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 0d49600c5..12d70266c 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -8298,29 +8298,11 @@ the @samp{x} into account later in the pipe. @table @asis @item @command{.} @prindex @command{.} -@prindex @command{source} Use @command{.} only with regular files (use @samp{test -f}). Bash 2.03, for instance, chokes on @samp{. /dev/null}. Also, remember that -@command{.} is not expected to look in the current directory, hence you -might need some wrapper code for relative paths: - -@example -# Some versions of Bash will fail to source /dev/null (special -# files actually), so we avoid doing that. -if test -r "$file" && test -f "$file"; then - case $file in - [\\/]* | ?:[\\/]* ) . $file;; - *) . ./$file;; - esac -fi -@end example - -Almost all the shells have a special handling for filenames containing -no slash, but they are not portable. For instance, Zsh sticks to -@code{$PATH} for @command{.}, while it first looks in the current -directory with @command{source}. Bash makes no difference between -@command{.} and @command{source} and looks in the current directory if -the file was not found in the @code{$PATH}. +@command{.} uses @env{PATH} if its argument contains no slashes, so if +you want to use @command{.} on a file @file{foo} in the current +directory, you must use @samp{. ./foo}. @item @command{!} @prindex @command{!} @@ -8561,7 +8543,9 @@ risc/os} 4.52 refuses to do it. @item @command{source} @c ------------------- -See the item @command{.} above. +@prindex @command{source} +This command is not portable, as @sc{posix} does not require it; use +@command{.} instead. @item @command{test}