나는 내장된 기능 .
과 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
source
내가 예상한 대로 되었지만 .
어떻게 해야 합니까?
답변1
man zshall
답변이 있습니다:
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 `)'