不会按高数字对列状态进行排序以降低。
{"ipaddr":"10.1.2.72","hostname":"qr01034","status":0,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.72","hostname":"qr01034","status":74,"diskusage":"/home/u0261072"},
{"ipaddr":"10.1.2.72","hostname":"qr01034","status":74,"diskusage":"/home/u0261072"},
{"ipaddr":"10.1.2.72","hostname":"qr01034","status":79,"diskusage":"/"},
{"ipaddr":"10.1.2.74","hostname":"qr01036","status":0,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.74","hostname":"qr01036","status":8,"diskusage":"/"},
{"ipaddr":"10.1.2.75","hostname":"qr01037","status":1,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.75","hostname":"qr01037","status":34,"diskusage":"/"},
{"ipaddr":"10.1.2.75","hostname":"qr01037","status":74,"diskusage":"/mnt/"},
{"ipaddr":"10.1.2.76","hostname":"qr01038","status":0,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.76","hostname":"qr01038","status":34,"diskusage":"/"},
{"ipaddr":"10.1.2.77","hostname":"qr01039","status":0,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.77","hostname":"qr01039","status":63,"diskusage":"/"},
{"ipaddr":"10.1.2.78","hostname":"qr01040","status":0,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.78","hostname":"qr01040","status":63,"diskusage":"/staging/"},
{"ipaddr":"10.1.2.78","hostname":"qr01040","status":74,"diskusage":"/mnt/"}
{"ipaddr":"10.1.2.78","hostname":"qr01040","status":81,"diskusage":"/"},
我尝试
sort -t: -k3,3r
但没有成功....
预期视图:
{"ipaddr":"10.1.2.78","hostname":"qr01040","status":81,"diskusage":"/"},
{"ipaddr":"10.1.2.72","hostname":"qr01034","status":79,"diskusage":"/"},
{"ipaddr":"10.1.2.72","hostname":"qr01034","status":74,"diskusage":"/home/u0261072"},
{"ipaddr":"10.1.2.72","hostname":"qr01034","status":74,"diskusage":"/home/u0261072"},
{"ipaddr":"10.1.2.75","hostname":"qr01037","status":74,"diskusage":"/mnt/"},
{"ipaddr":"10.1.2.78","hostname":"qr01040","status":74,"diskusage":"/mnt/"}
{"ipaddr":"10.1.2.77","hostname":"qr01039","status":63,"diskusage":"/"},
{"ipaddr":"10.1.2.78","hostname":"qr01040","status":63,"diskusage":"/staging/"},
{"ipaddr":"10.1.2.76","hostname":"qr01038","status":34,"diskusage":"/"},
{"ipaddr":"10.1.2.75","hostname":"qr01037","status":34,"diskusage":"/"},
{"ipaddr":"10.1.2.74","hostname":"qr01036","status":8,"diskusage":"/"},
{"ipaddr":"10.1.2.75","hostname":"qr01037","status":1,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.77","hostname":"qr01039","status":0,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.76","hostname":"qr01038","status":0,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.74","hostname":"qr01036","status":0,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.72","hostname":"qr01034","status":0,"diskusage":"/dev/shm"},
{"ipaddr":"10.1.2.78","hostname":"qr01040","status":0,"diskusage":"/dev/shm"},