Aks*_*til 5 shell bash io-redirection
我正在研究一个 bash 脚本代码,在那里我遇到了运算符“&>>”。我不明白它的用途。所以,我提到了http://www.gnu.org/software/bash/manual/html_node/Redirections.html。
它在语义上等同于>> file 2>&1.
以下是我的 shell 的输出:-
# echo $SHELL
/bin/bash
# echo "hello" &>> file1
bash: syntax error near unexpected token `>'
Run Code Online (Sandbox Code Playgroud)
和
# echo "hello" >> file1 2>&1
# cat file1
hello
Run Code Online (Sandbox Code Playgroud)
问题:- 为什么我收到错误bash: syntax error near unexpected token '>'?
[编辑] :- Bash 版本 3.2.25(1)-release (x86_64-redhat-linux-gnu)
| 归档时间: |
|
| 查看次数: |
3796 次 |
| 最近记录: |