Is there a standard Unix tool to create permutations?
I am using 'shuf' to create permutations of data, and in
GNU context I can also use 'sort -R' for that, it seems.
But inspecting the utilities section of the POSIX specs I
haven't found any tool for that purpose. - Is there any?
Note: I can of course use awk and program my own function,
but I was looking for a - similar to 'shuf' - ready to use
standard tool.
Janis
Is there a standard Unix tool to create permutations?
I am using 'shuf' to create permutations of data, and in
GNU context I can also use 'sort -R' for that, it seems.
But inspecting the utilities section of the POSIX specs I
haven't found any tool for that purpose. - Is there any?
Note: I can of course use awk and program my own function,
but I was looking for a - similar to 'shuf' - ready to use
standard tool.
On Tue, 22 Mar 2022 17:48:57 +0100, Janis Papanagnou wrote:
Is there a standard Unix tool to create permutations?
I am using 'shuf' to create permutations of data, and in
GNU context I can also use 'sort -R' for that, it seems.
But inspecting the utilities section of the POSIX specs I
haven't found any tool for that purpose. - Is there any?
Note: I can of course use awk and program my own function,
but I was looking for a - similar to 'shuf' - ready to use
standard tool.
Don't know if this fits your use-case, but the ptx(1) command
permutes it's inputs. ptx(1) builds a permuted index of a
file's contents, and is used to create the "permuted index"
index page in unix (paper) manuals.
Perhaps the permutations that ptx(1) builds will suffice for
your use-case
HTH
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 498 |
Nodes: | 16 (0 / 16) |
Uptime: | 64:46:03 |
Calls: | 9,813 |
Calls today: | 1 |
Files: | 13,754 |
Messages: | 6,189,220 |