小编Kev*_*hke的帖子

BASH - 将多个命令输出到列中

我正在尝试编写一个运行各种命令的脚本,并将每个命令的结果输出到一列,但是我无法将输出显示在列中.

#!/bin/bash

# Get GBP Neighbour NAMES
NEIGHBOR=$(vtysh -c 'show ip bgp neighbors' | grep Incoming | awk '{print $7}')

# Get IPs of BGP neighbours
IP=$(vtysh -c 'show ip bgp summary' | awk '{print $1}' | head -n -2 | tail -n +6)

# Get Up/Down time
TIME=$(vtysh -c 'show ip bgp summary' | awk '{print $9}' | head -n -2 | tail -n +6)

# Get State/PfxRcd
STATE=$(vtysh -c 'show ip bgp summary' | awk '{print $10}' | …
Run Code Online (Sandbox Code Playgroud)

linux bash shell multiple-columns output

3
推荐指数
1
解决办法
1362
查看次数

标签 统计

bash ×1

linux ×1

multiple-columns ×1

output ×1

shell ×1