命令“i3 --help”的输出不可 grep

命令“i3 --help”的输出不可 grep

当我输入时,i3 --help我得到这个输出:

Usage: i3 [-c configfile] [-d all] [-a] [-v] [-V] [-C]

-a          disable autostart ('exec' lines in config)
-c <file>   use the provided configfile instead
-C          validate configuration file and exit
-d all      enable debug output
-L <file>   path to the serialized layout during restarts
-v          display version and exit
-V          enable verbose mode

--force-xinerama
Use Xinerama instead of RandR.
This option should only be used if you are stuck with the
old nVidia closed source driver (older than 302.17), which does
not support RandR.

--get-socketpath
Retrieve the i3 IPC socket path from X11, print it, then exit.

--shmlog-size <limit>
Limits the size of the i3 SHM log to <limit> bytes. Setting this
to 0 disables SHM logging entirely.
The default is 0 bytes.

If you pass plain text arguments, i3 will interpret them as a command
to send to a currently running i3 (like i3-msg). This allows you to
use nice and logical commands, such as:

i3 border none
i3 floating toggle
i3 kill window

对于我到目前为止遇到的任何其他命令,此类--help选项的输出始终可以通过第二个命令(如grepor )进行管道传输和解析cat,并且我在此处验证了这一点。

你知道为什么 的输出i3 --help不是这样的吗?我真的是一个关于文件描述符的菜鸟,但我感觉它与它们有关。但是,我不知道该去哪里查看这一点。

答案1

可能此命令将输出发送到 STDERR。你可以这样 grep :

i3 --help 2>&1|grep string

2>&1会将 STDERR(文件处理程序 2)的输出重定向到 STDOUT(文件处理程序 1)

相关内容