安装 ocaml 和 opam 后,它已将此行添加到我的.bash_profile
(macOS( 中。
test -r /Users/myusr/.opam/opam-init/init.sh && . /Users/myusr/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
该脚本使用相同的模式调用更多。
对此test
二进制文件的每个调用,位于/bin/test
打印(红色(:
Directory isn't within a workspace: '/Users/myuser'
这是一个错误吗?什么意思?如果我不喜欢在打开终端时看到红色(类似错误(的消息,我是否应该从所有这些脚本调用中删除对test
的调用?
我找不到这方面的信息。
如评论中所述,运行后type -a test
OP 有 意识到某些东西覆盖了他们机器上的test
命令, 因此test
的异常行为.通常,type -a test
应该返回如下内容:
test is a shell builtin
test is /usr/bin/test
test is /bin/test
但是test
可以通过别名或将其转换为 功能:
$ alias test='echo fake test'
$ type -a test
test is aliased to `echo fake test'
test is a shell builtin
test is /usr/bin/test
test is /bin/test
$ test
fake test