slwl123
V2EX  ›  问与答

如何 删除 指定重复内容 的行 随机保留

  •  
  •   slwl123 · Dec 28, 2020 · 690 views
    This topic created in 2068 days ago, the information mentioned may be changed or developed.
    sort + uniq 输出结果只能为排序后的第一行
    1.1.1.1
    1.1.1.2
    1.1.1.5
    1.1.1.9
    2.2.2.3
    2.2.2.5
    2.2.2.6
    3.3.3.2
    3.3.3.3
    3.3.3.8
    3.3.3.9
    我想要的结果
    1.1.1.2
    2.2.2.5
    3.3.3.8
    就是在 有相同字符 的所有行中 随机抽取一行 输出

    请问 怎么用 shell 脚本实现
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2991 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 14:49 · PVG 22:49 · LAX 07:49 · JFK 10:49
    ♥ Do have faith in what you're doing.