如何并排打印两个 echo 命令的输出

如何并排打印两个 echo 命令的输出

我有两个命令

echo "dis q(*) where (IPPROCS gt 1)" |runmqsc UFISMQ |grep QUEUE | awk '{print $1}' |cut -c6-100

输出:

(SYSTEM.BROKER.CONTROL.QUEUE)
(TO_UFIS)
(ATC_IN)
(BELT_IN)
(COUNTER_IN)
(FLIGHT_IN)
(OTHERS_IN)
(TRIGGER_IN)

另一个命令

echo "dis q(*) where (IPPROCS gt 1)" |runmqsc UFISMQ |grep IPPROCS |cut -c11-15 |sed "1 d"

输出:

(3)
(18)
(2)
(2)
(2)
(2)
(2)
(2)

基本上这两个命令给出了队列名称和输入命令,我想并排发布,就像

(SYSTEM.BROKER.CONTROL.QUEUE)   (3)
(TO_UFIS)                       (18)
(ATC_IN)                   (2) 
(BELT_IN)                  (2) 
(COUNTER_IN)               (2)
(FLIGHT_IN)                (2) 
(OTHERS_IN)                (2)
(TRIGGER_IN)               (2)

答案1

你需要paste这样使用:

paste <(command1) <(command2)

在你的情况下是:

paste <(echo "dis q(*) where (IPPROCS gt 1)" |runmqsc UFISMQ |grep QUEUE | awk '{print $1}' |cut -c6-100) <(echo "dis q(*) where (IPPROCS gt 1)" |runmqsc UFISMQ |grep IPPROCS |cut -c11-15 |sed "1 d")

相关内容