Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • But the OP has a script called foo in has private bin directory ($HOME/bin), which appears at the beginning of his $PATH, so which foo will report /home/bob/bin/foo — which is not what the question is asking for. Commented Apr 3, 2015 at 0:07
  • I think it is bad practice to hide stuff in scripts. It only gets you into trouble. Making the user stumble if a configuration file is not set is better practice Commented Apr 29, 2015 at 16:08
  • (1) “… hide stuff in scripts”?  What?  I wonder whether you understand the question.  (2) “configuration file”?  Where did that come from?  (3) “[S]cripts should be very simple if they are to be deployed.”  OK, that’s your opinion, which (3a) doesn’t really help answer this question, and (3b) is, I suspect, a minority opinion.  Albert Einstein is credited with saying “Everything should be made as simple as possible, but not simpler.”  A script (or any other piece of software) should be as complicated as it needs to be to satisfy its requirements.  … (Cont’d) Commented Apr 29, 2015 at 20:52
  • (Cont’d) …  And (I’m not sure whether this is 3c or 4) you say scripts should be very simple, but that a script that executes a mv command should be distributed with a configuration file that tells it whether mv is in /bin or /usr/bin?  Seriously? Commented Apr 29, 2015 at 20:53
  • I do not think he is doing 'just' an mv. He is doing some munging and then calls /user/bin/foo ... Since /user/bin/foo may be somewhere else he needs to find it. I see this as bad design (my opinion). Because foo is a dependency that must be implicitly found (unbeknownst to the user). Commented Apr 29, 2015 at 21:36