可能重复:
如何在 Vim 中对数字和文字列进行排序
我必须根据线程 ID 对以下行进行排序。
Internal thread 0 bound to OS proc set {1}
Internal thread 1 bound to OS proc set {5}
Internal thread 2 bound to OS proc set {9}
Internal thread 10 bound to OS proc set {41}
Internal thread 9 bound to OS proc set {37}
当我发出:!sort -n
它们时,它们会像这样排序:
Internal thread 0 bound to OS proc set {1}
Internal thread 1 bound to OS proc set {5}
Internal thread 10 bound to OS proc set {41}
Internal thread 2 bound to OS proc set {9}
Internal thread 9 bound to OS proc set {37}
但我需要它们像这样排序:
Internal thread 0 bound to OS proc set {1}
Internal thread 1 bound to OS proc set {5}
Internal thread 2 bound to OS proc set {9}
Internal thread 9 bound to OS proc set {37}
Internal thread 10 bound to OS proc set {41}