Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • Thanks for doing all of this. I had to tweak a bit of it, i.e I put HOME=/Users/root (my home directory, I put it as root because why not. the root user's directory is /var/root so no harm) at the end because HOME=/dev/null was set and it never output anything because it was still in /dev/null. I also had to prefix all linux coreutils with g because if you couldn't tell by the former, I'm on Mac, so I installed a coreutils package from brew, and all coreutils are prefixed with g on it. (tr to gtr and dd to gdd). Commented Jun 25, 2015 at 2:02
  • The command takes an odd amount of time to run. Using time it says the command takes 6.89s. Commented Jun 25, 2015 at 2:07
  • @viktorahlström - i know - i rewrote, it actually. To my shame i used some pathological regexps in show(). I should have relied on sort all the while. I also abstracted some of the sed into some script generative functions. It's a helluva lot easier on the eyes. I'll post it in a minute. Commented Jun 25, 2015 at 3:23
  • @viktorahlström - the one I just posted will show "$deck" instantly. Commented Jun 25, 2015 at 3:41
  • @viktorahlström - $HOME = /dev/null in the subshell - it is only to be able to do paste -d - ~ - ~ and mean paste -d - /dev/null - /dev/null - it's just a simple shortcut. And you really shouldn't need any coreutils for this to work either - it's all POSIX code. Admittedly some sed's do not adhere to spec where /\(match\)\{[num-repeat\}/ is concerned - they don't properly handle repeat intervals for submatches despite the spec clearly defining its intent there. I could make that a little more portable perhaps. Everything else should work fine. deck() won't w/out HOME=/dev/null. Commented Jun 25, 2015 at 5:09