linux - 这里 >& 是什么意思?

标签 linux bash

我有已编译的 C 代码。然后我必须从命令行执行

../../../PStomo_eq665/pstomo_eq par=syn.par >& log.syn

在这种情况下,>& 是什么意思? syn.parlog.syn 文件都包含 pstomo_eq 的参数。

最佳答案

重定向标准错误和标准输出

>& 等同于 &> 并重定向标准错误 和标准输出

来自 bash man页:

There are two formats for redirecting standard output and standard error:

&>word

and

>&word

Of the two forms, the first is preferred. This is semantically equivalent to:

>word 2>&1

在你的问题中,stderrstdout 被重定向到 log.syn

关于linux - 这里 >& 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34900604/

相关文章:

bash - 通过 sh、curl、mailgun 将文件内容作为电子邮件文本发送

linux - 当我在我的一个文件上使用 mv 时,它消失了

linux - 面对不同步的时钟,inotify 是否有效?

linux - Bash 退出状态在脚本中不起作用

linux - BASH 休眠并向程序发送击键

windows - git-bash 中的 curl 命令

Linux串口的正确初始化顺序

java - 通过 bjdwp 在 Linux 上调试黑莓

linux - Python 更新 Linux (Raspberry Pi)

bash - 通过 Shell Bash 脚本从 build.gradle 获取 Gradle 项目版本