• esa@discuss.tchncs.de
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    16 hours ago

    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”

    • LeFantome@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      9 hours ago

      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.