想要按数字 desc 或 asc 对列“usedsize”进行排序。
输入:
{"name":"db1","tablespace":"TEMP","size":"1000","maxsize":"65536","usedsize":"21","status":0.03},
{"name":"db1","tablespace":"DAT","size":"360612","maxsize":"475680","usedsize":"360321","status":75.75},
{"name":"db1","tablespace":"CUNBDAT","size":"23800","maxsize":"131072","usedsize":"23694","status":18.08},
我尝试使用分隔符和列行,但似乎有问题:
sort -t: -k10
预期视图:
{"name":"db1","tablespace":"DAT","size":"360612","maxsize":"475680","usedsize":"360321","status":75.75},
{"name":"db1","tablespace":"CUNBDAT","size":"23800","maxsize":"131072","usedsize":"23694","status":18.08},
{"name":"db1","tablespace":"TEMP","size":"1000","maxsize":"65536","usedsize":"21","status":0.03},