【发布时间】:2018-10-12 05:21:21
【问题描述】:
我有一个命令的示例输出
+--------------------------------------+------------------+---------------------+-------------------------------------+
| id | fixed_ip_address | floating_ip_address | port_id |
+--------------------------------------+------------------+---------------------+-------------------------------------+
| 04584e8a-c210-430b-8028-79dbf741797c | | 99.99.99.91 | |
| 12d2257c-c02b-4295-b910-2069f583bee5 | 20.0.0.92 | 99.99.99.92 | 37ebfa4c-c0f9-459a-a63b-fb2e84ab7f92 |
| 98c5a929-e125-411d-8a18-89877d3c932b | | 99.99.99.93 | |
| f55e54fb-e50a-4800-9a6e-1d75004a2541 | 20.0.0.94 | 99.99.99.94 | fe996e76-ffdb-4687-91a0-9b4df2631b4e |
+--------------------------------------+------------------+---------------------+-------------------------------------+
现在我想获取 "port_id" & "fixed_ip_address" 字段为 空白的所有 "floating _ip_address" /empty(在上述示例 99.99.99.91 和 99.99.99.93 中)
如何使用 shell 脚本来做到这一点?
【问题讨论】:
-
你都试过什么?
标签: bash shell ubuntu for-loop openstack