답변:
bash슬래시 (가없는 내부 커맨드 소스는, 우선, 경로의 파일명을 찾는다 /파일명의가). xset는 PATH의 실행 파일이므로 문제입니다.
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.
현재 쉘 컨텍스트 의 파일 이름 인수에서 명령을 읽고 실행하십시오 . 경우 파일 이름이 슬래시를 포함하지 않는의
PATH변수를 찾는 데 사용되는 파일 이름을 .
이 동작 은 ( .별칭으로) POSIX에 의해 정의 됩니다 . 왜? 음, 소스 가능한 구성 스크립트를 내부에 넣고 PATH정규화 된 경로없이 액세스 할 수 있습니다. 원하는 파일에 액세스하려면 대신 절대 또는 상대 경로를 지정하십시오.
source ./xset
source ~/xset
source /home/shawn/xset
위의 모든 내용은 처음에 예상 한대로 작동합니다. 또한 해제 할 수 있습니다 sourcepath로 shopt.
xset있습니다. 시도하십시오source ./xset.