bash ->>& 在 tcsh 脚本中是什么意思,它如何转换为 bash?

标签 bash stdout stderr tcsh

我正在将 tcsh 脚本转换为 bash,遇到障碍因为我不完全确定 >>& 做了什么

wget --output-document=/dev/null "http://somewebsite.org" >>& /root/wget.log

我确实阅读了手册页 http://linux.die.net/man/1/tcsh但不确定“路由诊断”是什么意思,可能是标准错误...

所以,为了绝对确定,它是否与以下操作相同:

wget --output-document=/dev/null "http://somewebsite.org" 2>>&1 /root/wget.log

在 bash 脚本中?

最佳答案

它将 stdout 和 stderr 附加到文件中,因此它等同于:

wget --output-document=/dev/null "http://somewebsite.org" >> /root/wget.log 2>&1

关于bash ->>& 在 tcsh 脚本中是什么意思,它如何转换为 bash?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30269427/

相关文章:

stderr - 读取 php ://stderr

bash - 为什么我的 "exit"命令没有退出我的 Bash 脚本?

javascript - 拆分标准输出并将每个部分通过管道传输到命令

python - contextlib.redirect_stdout 总是一个好主意吗?

python - 使用 Python 从正在运行的脚本中读取标准输出

command-line-interface - 如何删除/禁用 gcloud CLI 命令的输出消息

linux - 为什么我的 sed 替换为 & 无法执行?

linux - Bash - 错误信息 'Syntax error: "("unexpected'

c - 当给定无效路径时,freopen()创建一个文件

python - stderr(来自 GDAL)未显示在 Python shell 中