我想对这些数字进行排序
36毫秒 4毫秒 44毫秒 8毫秒
像这样4毫秒 8毫秒 36毫秒 44毫秒。
在linux中使用sort命令。感谢
16:59:52.092 - 16:59:52.121 PhysicalSharedChannelReconfigurationRequestFDD - PhysicalSharedChannelReconfigurationResponse 29 ms
16:59:51.940 - 16:59:51.943 PhysicalSharedChannelReconfigurationRequestFDD - PhysicalSharedChannelReconfigurationResponse 3 ms
16:59:52.092 - 16:59:52.130 PhysicalSharedChannelReconfigurationRequestFDD - PhysicalSharedChannelReconfigurationResponse 38 ms
16:59:52.029 - 16:59:52.068 PhysicalSharedChannelReconfigurationRequestFDD - PhysicalSharedChannelReconfigurationResponse 39 ms
16:59:52.092 - 16:59:52.133 PhysicalSharedChannelReconfigurationRequestFDD - PhysicalSharedChannelReconfigurationResponse 41 ms
17:59:34.248 - 17:59:34.253 PhysicalSharedChannelReconfigurationRequestFDD - PhysicalSharedChannelReconfigurationResponse 5 ms
18:14:39.263 - 18:14:39.268 PhysicalSharedChannelReconfigurationRequestFDD - PhysicalSharedChannelReconfigurationResponse 5 ms
19:41:59.355 - 19:41:59.360 PhysicalSharedChannelReconfigurationRequestFDD - PhysicalSharedChannelReconfigurationResponse 5 m
答案 0 :(得分:1)
echo '36 ms 4 ms 44 ms 8 ms' | xargs -n 2 | sort -n -k1 | tr '\n' ' '
使用UNIX排序技巧,但你必须通过拆分和重新组合输入的中间步骤