you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 1 year ago* (2 children)

For those who want to give it a go:

#!/bin/bash
set -euo pipefail

while read -rd ":" path
do
  for bin in "$path"/*
  do
    # don't error out if there's no manpage
    set +e
    man "$(basename "$bin")"
    set -e
  done
done < <(printf '%s%s' "$PATH" ":")

when you get sick of it, hit ^Z (ctrl-z) and go kill %1. Then you get to start all over from the start next time!

Bonus points for starting a tracker so you can count how long it takes to go from "eugh, what's with that overwrought and excessively defensive bash script" to "fuck, now I'm doing it too"

  • source
  • hideshow 2 child comments
  • [–] 2 points 1 year ago (1 child)

    I am not much of a bash guy so it took me a moment to understand what this was doing.

    Too bad I have to read so many man pages before I get to bash or sh.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 1 year ago

    Well, bash should show up quickly enough. But yeah.

    I'm also no longer much of a bash guy. Back when I was my scripts were a lot simpler, and broke in weird ways a lot more. And every time I picked up a new defensive habit, my bash became a little bit uglier, and I thought to myself "maybe I should just do this in Python".

    But this script would be a lot longer in Python.

  • source
  • parent