0
USERNAME=root
HOSTS="192.168.122.91 192.168.122.102 192.168.122.180"
SCRIPT="df -h /dev/vda3 | grep '/export/brick' | awk '{print $2}' ";
for HOSTNAME in ${HOSTS} ; do
(ssh -l ${USERNAME} ${HOSTNAME} "${SCRIPT}")
done
輸出是:選擇文本使用awk命令
/dev/vda3 27G 722M 26G 3% /export/brick
期望的輸出= 27G