我曾经认为内置函数.
和source
是等效的。这个问题与我一致bash
。但是我遇到了以下使用zsh
:
desktop? ~/pst . env
/usr/bin/env:1: no such file or directory: ^@^A^@^@^@X^Z@^@^@^@^@^@@^@^@^@^@^@^@^@\M-8q^@^@^@^@^@^@^@^@^@^@@^@8^@
/usr/bin/env:2: parse error near `)'
desktop? ~/pst source env
desktop? ~/pst file env
env: ASCII text
Run Code Online (Sandbox Code Playgroud)
source
做了我所期望的,但是.
想要做什么?
Eri*_*rik 13
man zshall
有答案:
Run Code Online (Sandbox Code Playgroud)source file [ arg ... ] Same as `.', except that the current directory is always searched and is always searched first, before directories in $path.
例子:
desktop? ~/pst source /bin/env
/bin/env:1: no such file or directory: ^@^A^@^@^@X^Z@^@^@^@^@^@@^@^@^@^@^@^@^@\M-8q^@^@^@^@^@^@^@^@^@^@@^@8^@
/bin/env:2: parse error near `)'
desktop? ~/pst . env
/usr/bin/env:1: no such file or directory: ^@^A^@^@^@X^Z@^@^@^@^@^@@^@^@^@^@^@^@^@\M-8q^@^@^@^@^@^@^@^@^@^@@^@8^@
/usr/bin/env:2: parse error near `)'
Run Code Online (Sandbox Code Playgroud)