[sf-lug] much can be said for ... for i in /usr/share/man/man*; do man $i/*; done

Asheesh Laroia asheesh at sandstorm.io
Tue Aug 23 08:32:44 PDT 2016


On Tue, Aug 23, 2016 at 11:27 AM, GoOSSBears <acohen36 at linuxwaves.com>
wrote:

> First quoting Michael Paoli (Michael.Paoli at cal.berkeley.edu):
> >> I like looking over stuff in the directories on PATH, for anything
> >> in them that I don't recognize or not all that sure what it does or
> >> what it's for - and having a look at the man page.  :-)
> >>
> >> Have found some really cool stuff by such, or similar means.
> >> E.g. tac(1) - so very handy.
>
> Then quoting Rick Moen (rick at linuxmafia.com)
> > Oh yeah.  Looking at the man pages for new discoveries
> > can be a heady and revelatory experience!
>
> Well "RTFM ;)" certainly applies for tac(1).
> I also don't think simple command line pipelines such as 'for i in
> /usr/share/man/man*; do man $i/*; done' would require much in the way of
> RTFM or further comments.
>
> OTOH, it would certainly help readers a great deal if slightly more
> complex command line pipelines are better described elsewhere, e.g.
> clearing up what the lines of the pipeline found at http://linuxmafia.com/
> pipermail/sf-lug/2016q2/011832.html actually perform:
> ~~~~~~ quoting ~~~~~~
> $ (for ns in $(dig -t NS github.com. +short | sort); do echo $(dig \
> > @"$ns" +noall +answer github.com. A github.com. AAAA) "[$ns]"; done)

~~~~~~~~~~~~~~~~~~~~~
>
> Of course we could delve through the 'dig' man page and *eventually* find
> out the description, purpose and actions of the above person's command line
> pipeline.
>

Fair enough! : )

For what it's worth, I really like this website for explaining shell
commands:

http://explainshell.com/

You can try it out by pasting the quoted one-liner into it.

If you do that, you end up at this URL:

http://explainshell.com/explain?cmd=%28for+ns+in+%24%28dig+-t+NS+github.com.+%2Bshort+%7C+sort%29%3B+do+echo+%24%28dig+%5C+%3E+%40%22%24ns%22+%2Bnoall+%2Banswer+github.com.+A+github.com.+AAAA%29+%22%5B%24ns%5D%22%3B+done%29

which explains all sub-commands in there, for example:

http://explainshell.com/explain?cmd=dig%20-t%20NS%20github.com.%20+short%20|%20sort

If you mouseover "-t NS" it explains:

"The -t option sets the query type to type. It can be any valid query type
which is supported in BIND 9.
The default query type is "A", unless the -x option is supplied to indicate
a reverse lookup. A zone
transfer can be requested by specifying a type of AXFR. When an incremental
zone transfer (IXFR) is
required, type is set to ixfr=N. The incremental zone transfer will contain
the changes made to the zone
since the serial number in the zone's SOA record was N."

I find the site pretty impressive.

I think there's a balance be struck between:

- How much extra work beyond the bare minimum that we can reliably expect
from nice people on this email list

- How to make sure they stay motivated (I know I am personally motivated by
being able to brag about cool things I know, where knowing the thing makes
me look impressive)

- How to make sure the people reading the emails can understand the
information provided

Perhaps it'd be neat to have a link to explainshell.com in the Mailman
footer that comes with every email from this list, so that a greater number
of people have it, and can use it as a sort of "decoder" for what complex
cool shell commands people do send to this list.

Cheers,

Asheesh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linuxmafia.com/pipermail/sf-lug/attachments/20160823/5a600a8a/attachment.html>


More information about the sf-lug mailing list