3 ms·
nushell's sort and uniq do what you might expect, operating on the whole value (line). Copying the data to the clipboard (hence pbpaste; substitute if necessary
by dwb 3y ago
nushell's sort and uniq do what you might expect, operating on the whole value (line). Copying the data to the clipboard (hence pbpaste; substitute if necessary):
~: pbpaste | split row "\n" | sort -n | uniq
╭───┬─────────────────────────╮
│ 0 │ 1 a │
│ 1 │ 5 which │
│ 2 │ 10 exotically │
│ 3 │ 15 aerodynamically │
│ 4 │ 15 differentiation │
│ 5 │ 20 electroencephalogram │
╰───┴─────────────────────────╯
- Izkata 3y agoIt's not nushell doing that, those are the same sort and uniq tools that they mention at the bottom of the post.
- dwb 3y agoNo, nushell has its own built-in implementations that are aware of nushell's richer type system: https://www.nushell.sh/commands/docs/sort.html https://www.nushell.sh/commands/docs/sort.html https://www.nushell.sh/commands/docs/uniq.html https://www.nushell.sh/commands/docs/uniq.html