News for hackers. Stuff that matters.
Re:Unix Toolbox by jastr on Friday August 07, 2015 @03:25PM (#10024454)
Bro Pages (instead of "man" pages) is a similar resource I find myself using surprisingly often http://bropages.org/browse
Re:Unix Toolbox by teddyh on Friday August 07, 2015 @05:49PM (#10025216)
That project is a symptom of manual pages not having good “EXAMPLES” sections. The examples on that web page should be contributed upstream to the manuals pages of the software that they are for.

If you want a fast way to read the EXAMPLES section only for a command, here is a shell function which creates an ‘eg’ command which only displays the “EXAMPLES” section of manual pages:

  eg(){
      MAN_KEEP_FORMATTING=1 man "$@" 2>/dev/null \
          | sed --quiet --expression='/^E\(\x08.\)X\(\x08.\)\?A\(\x08.\)\?M\(\x08.\)\?P\(\x08.\)\?L\(\x08.\)\?E/{:a;p;n;/^[^ ]/q;ba}' \
          | ${MANPAGER:-${PAGER:-pager -s}}
  }
Usage:

  $ eg tar
  EXAMPLES
       Create archive.tar from files foo and bar.
             tar -cf archive.tar foo bar
       List all files in archive.tar verbosely.
             tar -tvf archive.tar
       Extract all files from archive.tar.
             tar -xf archive.tar
  $
Re:Unix Toolbox by voltagex_ on Saturday August 08, 2015 @02:27AM (#10026527)
Any ideas where I'd find how to submit the man page patches? Some upstreams are incredibly hard to find.
Re:Unix Toolbox by teddyh on Saturday August 08, 2015 @04:32AM (#10026706)
Can you give me an example? What I’d do it look at the Debian package, which both documents where upstream is and has a bugtracker of its own which you can submit suggestions to, and the Debian maintainer should forward the submission to upstream if appropriate.
Re:Unix Toolbox by voltagex_ on Saturday August 08, 2015 @09:50AM (#10027228)
Aaand it eludes me - I'll keep that in mind for the next time I find a manpage without examples.
Re:Unix Toolbox by alanning on Friday August 07, 2015 @08:25PM (#10025817)
Thank you, this is really helpful.

Could anyone contribute a version for OSX?

Re:Unix Toolbox by guac on Friday August 07, 2015 @09:14PM (#10025942)
If you have homebrew you can just install the 'gnu-sed' package and then change the function to call 'gsed' instead.
Re:Unix Toolbox by dewarrn1 on Saturday August 08, 2015 @11:45AM (#10027562)
Here's my terribly hackish version for BSD userlands (briefly tested on FreeBSD, may work on OS X):

    #!/bin/sh
    eg () {
        man $1 | grep '^E.EX.XA' -A 1000 | grep '^[A-Z]' -m 2 -B 1000 -A 0 | sed '$d' | $PAGER
    }
    eg $1
Re:Unix Toolbox by vezzy-fnord on Friday August 07, 2015 @04:14PM (#10024720)
Damn, I remember the HN thread about that. The derailing was phenomenal. Interesting that the project lives on.
Re:Unix Toolbox by raldu on Saturday August 08, 2015 @06:37AM (#10026882)
Although slightly different, Commandlinefu is a similar project with many number of entries: http://www.commandlinefu.com

It also has a terminal client called "fu": https://github.com/samirahmed/fu

Re:Unix Toolbox by therealmarv on Friday August 07, 2015 @05:45PM (#10025193)
just tried out to install bro pages with a fresh ruby 2.2.1 from rvm on OS X and got this reproducable. Seems broken for me:

    $ bro curl
    The curl command isn't in our database.
Re:Unix Toolbox by nemild on Friday August 07, 2015 @06:17PM (#10025346)
You might have an easier time getting tldr pages to work: https://github.com/tldr-pages/tldr