回答:
bashスラッシュ(存在しない限り、内部コマンドソースは、まず、PATHでファイル名を探し/、ファイル名では)。xsetPATH内の実行可能ファイルなので、問題があります。
以下を使用してsource ./xset、sourcepathオプションを実行またはオフに変更できます。
shopt -u sourcepath
bashマンページ:
source filename [arguments]
Read and execute commands from filename in the current shell
environment and return the exit status of the last command exe‐
cuted from filename. If filename does not contain a slash, file
names in PATH are used to find the directory containing file‐
name. The file searched for in PATH need not be executable.
When bash is not in posix mode, the current directory is
searched if no file is found in PATH. If the sourcepath option
to the shopt builtin command is turned off, the PATH is not
searched. If any arguments are supplied, they become the posi‐
tional parameters when filename is executed. Otherwise the
positional parameters are unchanged. The return status is the
status of the last command exited within the script (0 if no
commands are executed), and false if filename is not found or
cannot be read.
現在のシェルコンテキストのfilename引数からコマンドを読み取り、実行します。filenameにスラッシュが含まれていない場合、
PATH変数はfilenameの検索に使用されます。
この動作は.、POSIXによって(のエイリアスとして)定義されています。どうして?ええと、ソース可能な構成スクリプトを内部に配置してPATH、修飾パスなしでそれらにアクセスできます。必要なファイルにアクセスするには、代わりに絶対パスまたは相対パスを指定します。
source ./xset
source ~/xset
source /home/shawn/xset
上記のすべてが当初の期待どおりに機能します。また、無効にすることができsourcepathてshopt。
xsetます。お試しくださいsource ./xset。