How can I randomize the lines in a file using standard tools on Red Hat Linux?

前端 未结 11 1037
醉酒成梦
醉酒成梦 2020-11-28 05:25

How can I randomize the lines in a file using standard tools on Red Hat Linux?

I don\'t have the shuf command, so I am looking for something like a

11条回答
  •  盖世英雄少女心
    2020-11-28 05:51

    FreeBSD has its own random utility:

    cat $file | random | ...
    

    It's in /usr/games/random, so if you have not installed games, you are out of luck.

    You could consider installing ports like textproc/rand or textproc/msort. These might well be available on Linux and/or Mac OS X, if portability is a concern.

提交回复
热议问题