Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一些帮助,因为我无法弄清楚错误。
read input echo -e "$input" | cut -c4- cd "$input" | cut -c4-
所以我输入cd test,回显输出是正确的test。
cd test
test
我想更改目录,但它给出了cd cd test.
cd cd test
任何帮助表示赞赏。
你想要的应该是:
cd $(echo -e "$input" | cut -c4-)
也可以像这样完成(参见 bash “here strings”)
cd $(cut -c4- <<<$input)