举个例子,
systemd status weechat |grep Active
systemd 的输出根据状态为绿色或红色。
通过 grep(或其他命令,如 tail,...)进行管道传输时如何保持这一点?
有--color,但不是那个。
.
使用
script
script -qec systemd status weechat |grep Active