Re: effing Nader



<rkshullat@xxxxxxxxxxxxxxxxx> wrote:
> Joe Ellis <synthfilker@xxxxxxxxxxxxx> wrote:
>> No, you're just hiding behind a deliberately unreadable command.

Of course it's unreadable to anyone who doesn't know the language.
You have to *learn* languages. At least GUI fans no longer make the
silly claim that their interface is "intuitive," at least not in the
sense that it offers the power of a language without the bother of
having to learn a language. As I've said, I don't think it offers the
power of a language no matter how much effort you put into learing it.

>> Tell me what it means in plain English, and I'll bet it's simple in
>> Mac OS X. Probably takes fewer keystrokes, too. And it'll be a
>> DAMN sight easier to understand.

> I think it was:
> "cat a??b | sort | uniq -c | fgrep -v -i -f foo | sort -r | more"

> It concatenates the contents of all files in the current directory
> whose names are exactly 4 characters in length, start with 'a' and
> end with 'b'. It then sorts the result lexically according to the
> default sorting rules for the system or environment, removes
> sequentially duplicated lines and outputs each line prepended by the
> number of times that line appeared in sequence. The resulting output
> is then filtered to show all lines which do not match any of the
> non-case sensitive set of strings contained in the file "foo", and
> finally sorted in reverse order and output one "page" at a time.

Right.

> I'm not sure exactly what, if anything, Keith uses that command line
> for, but I use similar constructions on a daily basis.

It's loosely based on something I've done for WSFA meetings. Say each
file that begin with "a" and end with "b" is a list of everyone who
was at a particular meeting, with one name per line. And that there's
one such file for every meeting, ever. And that the file "foo" is a
list of paid members. Then that command generates a list of everyone
who has attended meetings but is not a paid member, in descending
order of attendance, along with the total number of meetings they've
attended.

I look forward to hearing how Joe Ellis would do the same, with less
time and effort than it took me to type this sentence.

> And given the "uniq -c" in the middle the final sort should probably
> have "-n" as an option to sort the line counts numerically.

Not necessary unless the numbers are six or more digits. I won't have
to worry about it for another 4000 years or so.

Like you, I use such commands every day. It's not really that much
learning. Mostly just the commands cat, cut, diff, fg, [f]grep, ls,
sed, sort, tee, and uniq, together with their more useful switches,
the connectors |, <, >, and >>, and how regular expressions work.
Throw in awk, and you may never need to resort to perl or java,
much less C.

Then there's emacs, which has a different set of strengths. I
actually spend most of my online time in emacs.
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
.



Relevant Pages

  • Re: effing Nader
    ... you're just hiding behind a deliberately unreadable command. ... > Of course it's unreadable to anyone who doesn't know the language. ... > It's loosely based on something I've done for WSFA meetings. ...
    (rec.arts.sf.fandom)
  • OT Whore Words (was Shall I use the before...) OT
    ... I will do a favor for readers, especially learners of English. ... Command of language has nothing to do with being an annoying ... and how to succeed in life by doing so. ...
    (alt.usage.english)
  • Re: delete command weirdness
    ... Thinking of a function as a command may warp your expectations. ... It does have pedants. ... market, mind you, but not because they didn't work by side-effect.) ... really proceed by analysis of the fixed constraints of the language, ...
    (comp.lang.lisp)
  • Re: DCL Coding Standards
    ... I also like the underscore when the label appears in a command. ... If the tab stops are off, reset them to the default of every 8 columns. ... other language processors may require spaces or TABs to delimit ...
    (comp.os.vms)
  • Re: CFO: Why C?
    ... C is /also/ a good language in which to write non-trivial ... Not even C is a silver bullet. ... prompt asking for a renaming command to be entered on standard input. ...
    (comp.os.linux.development.apps)

Loading