in reply to 001-inpath verify if command is in PATH
in thread Wicked Cool Shell Scripts implemented in Perl

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.

Replies are listed 'Best First'.
Re^2: 001-inpath verify if command is in PATH
by szabgab (Priest) on Mar 27, 2006 at 16:26 UTC
    yep, you are right in this case, now I wonder how well can I really use that book to learn what people use shell scripts for.