Note: I'm not directing these comments against you (the OP) since you only ported a tool written by somebody else.

The inpath gizmo does basically the same thing as the shell util which, with a couple additions of very questionable usefulness:

  1. Search in the current directory. Why treat the cwd differently? The cwd is not put in the PATH in most standard shell setups mostly for security reasons. If you want it in your PATH, damn ADD IT! This is not MS-DOS people! Searching for an executable in other locations than the directories in PATH defies the semantics of PATH. The shell will search for an unqualified executable ONLY in directories from PATH, again, do I have to say, unlike MS-DOS and derivatives.
  2. Search for non-executable files in PATH. This is moronic, plain and simple. It serves no other purpose than to complicate the interface. Yeah, anybody can come with any excuse, but the truth is, the cost of feature creep outweights the benefit of usefulness, even for such small a program. Especially when the feature is in fact a non-feature.

The first addition almost surely betrays the author's roots and nostalgia... The second addition, I'm beginning to think he felt a little "creative", going for a little filler, a little embellishment, particularly when the core "algorithm" was already in place and it cost only a few keystrokes...

I'm writing this because I'm sick of these "creative" people. Is it just me or does anybody else feel the same? This little crappy program is just a symptom of this "creativity" that IMO contributes to much of the sloppiness, lameness and feature creep we find in programs we use everyday. Watch out for an idiot with a drive.


In reply to Re: 001-inpath verify if command is in PATH by calin
in thread Wicked Cool Shell Scripts implemented in Perl by szabgab

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.