
複数のコマンドの出力を単一の grep にパイプしたいと思います。
例:
次の 2 つの行を結合したいと思います。
smartctl -A /dev/sda | grep -e Reallocated_Event_Count -e Current_Pending_Sector
smartctl -A /dev/sdb | grep -e Reallocated_Event_Count -e Current_Pending_Sector
(これら 2 つの行の唯一の違いは、ディスクが異なる点 (sda と sdb) であることに注意してください)
ご協力いただければ幸いです。
ありがとう
答え1
あなたが試すことができます:
(smartctl -A /dev/sda ; smartctl -A /dev/sdb) | grep -e ....