我试图在zsh(oh-my-zsh)中执行一些bash脚本 . 我发现$ 在zsh中不起作用 .
庆典:
bash-3.2 $ $ / tmp; echo“test”>> test.txt; $ test.txt bash:/ tmp:是目录测试
zsh的:
〜$ / tmp; echo“test”>> test.txt; $ test.txt zsh:找不到命令:tail-f✘/ tmp
但直接使用尾巴很好
✘/ tmp tail -f test.txt test test whereis tail / usr / bin / tail echo $ PATH / usr / local / bin:/ usr / bin
1 回答
我认为这是
zsh
中的经典案例Why does $var where var="foo bar" not do what I expect?与
bash
不同,默认情况下,zsh
在传递给命令或在循环中用作for foo in $var
时不会分割为单词 .手动启用标志为
然后尝试相同的