Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

You forgot the rest of that irc conversation:

<chanop> Why isn't Z relevant? <user> Because Y. <chanop> But Y isn't a good reason. Let me explain... [dozens of lines of explanation snipped] <user> Oh. Maybe I should try Z...
At least, that's how it used to be on OPN/#perl when it was still relatively small and friendly.

So, you were bothered by my reply. I'm left wondering why you were bothered that I asked: "Why go to all that trouble?" and then added "The GNU fileutils package compiles neatly on Solaris 8." as an explanation. Perhaps you feel underestimated. Perhaps you think that when you ask a question I should assume that you know what you are doing and not question your enlightened approach. You might even be right but its a rather ungracious attitude to have when you are seeking help.

You complained about the answer I gave you when, in fact, my response wasn't intended to be an answer at all, but a probe for more information. Since you seem taken aback by it, I'll explain why I questioned you. In your original post you wrote:

(the principle being, if youre going to do it a bunch of times, you want it to be fast)

You want it to be fast. Fine, we'll ignore that you want to start up a perl interpreter for this... But why ask for a golfed solution? Short doesn't mean fast and the shortest solution for many problems is far slower than the fastest. Asking for the two things together is kind of, uh, green. Because you want it to be part of a shell alias isn't, by itself, a good justification for a golfed solution either. Shortish may be nice, maybe, but why golfed? Admittedly, it's ugly in tcsh but if you are using tcsh you are probably used to doing ugly things similar to:

alias blahblah 'du | perl -e '\''\\ ... \\ ... \\ ... \\ '\'

If, on the other hand, you did decide to use GNU du/df binaries, they weigh in at about 45k (stripped) each. I don't think they rely on special libraries, so you wouldn't have to install a package, you'd probably just have to copy the binaries around. (If you really have a lot of machines, NFS would probably make life easier.) Not only are they fast, they provide additional functionality and unlike shell aliases, they can be reliably called from scripts.

Shell aliases are useful for many things but I wouldn't use one for this because it seems to me like too much complexity for too little gain. I would either use the GNU versions or get used to reading long numbers. (In fact, I have many gnu tools in my ~/bin which is automounted on most of the machines I work on but I tend to just use -k with df/du even though our arrays have 150Gb+. It comes pretty easily after a bit.)

If you really insist on using aliases, I recommend against calling them "du" or "df" because you'll get frustrated all over again when you regularly find the need to use the commands with other switches like df -e or du -L.

Back to the point...

In your sig, you list "Generosity" along with the three great virtues of a programmer. I don't know that it really takes generosity to be a great programmer but it is certainly a quality worth having. Another one is humility. Humility enables us to truly accept the generosity of others.

"My two cents aren't worth a dime.";

In reply to Re: Re: A little golf anyone? by sauoq
in thread A little golf anyone? by deprecated

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2023-06-05 13:03 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (24 votes). Check out past polls.