DR_PERMUTATE(1)

πŸ“¦
this version Β· 4 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’« DR_PERMUTATE(1) β€” the Draai era, bestie πŸ’«

okay so listen. this is dr_permutate, a lil script from the Draai corner of the internet, and its whole personality is: shuffle things around. that's it. that's the job. πŸŽ€


✨ NAME ✨

dr_permutate β€” print randomly permutated arguments or stdin πŸ¦‹


🌸 SYNOPSIS 🌸

dr_permutate arguments dr_permutate

πŸ’– DESCRIPTION πŸ’–

so here's the vibe. when you call dr_permutate with arguments, it hands them right back to you in a randomly permutated order, all space separated. like it took your little list and gave it a glow-up and a new seating arrangement. slay. ✨

but when you call it without any arguments? bestie, now it's reading from stdin. dr_permuate expects a line-oriented file on stdin, and it returns the contents of that file with the lines randomly permutated. same energy, different source. πŸ’…


πŸŽ€ EXAMPLE πŸŽ€

running this:

$ dr_permutate foo bar baz

could return:

bar foo baz

periodt. πŸ’–

and running this:

$ cat <<EOF | dr_permutate
foo
bar
baz

could return:

bar
foo
baz

no cap, that's genuinely all it does. πŸ”₯


πŸ•°οΈ HISTORY πŸ•°οΈ

this script was initially written on 2001-05-06. an icon. a legend. older than most of your faves fr fr. πŸ‘‘


πŸ’€ BUGS πŸ’€

okay so, real talk, two things:

  • when called without any arguments, stdin is read in core entirely. the whole thing. into memory. so maybe don't feed it a 40GB file unless you want your RAM to have a moment. 😭
  • the GNU coreutils utility shuf(1) implements the same functionality in a better way, and you're probably better off using that. not me admitting the competition ate. πŸ™ˆ

πŸ‘€ SEE ALSO πŸ‘€


Copyright: (c) 2001 Joost van Baal

This script is in the public domain. 🫢


🌈 AUTHOR 🌈

Joost van Baal <joostvb@mdcc.cx>


and that's the whole page, bestie! this one's from the draai crew, version 20201215, dated 2020-07-05. go shuffle something cute. mwah. πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from