On 2018-12-06 12:39, Achim Gratz wrote: > Thomas Wolff writes: >> Am 05.12.2018 um 21:21 schrieb Achim Gratz: >>> Thomas Wolff writes: >>>> Ensuring /bin in PATH for user commands. >>> Blindly prepending /bin to the existing PATH is asking for trouble with >>> certain setups.
Many setups: my Windows User PATH includes Cygwin {,/usr/local}/{,s}bin and the Windows System PATH, and my login scripts append new Cygwin paths before any Windows paths, used to allow interop using Cygwin and Windows consoles with Cygwin and non-Cygwin apps, which may only or also be available in MinGW/native exes e.g. BitKeeper. >> Just to clarify, this is only applicable to user-defined commands >> added to the extended context menu (option UserCommands), in order to >> ensure basic tools are available. If you see problems there, please be >> more specific. > > I'm not using this option, so my remark was just to remind you that > second-guessing the user w.r.t. PATH will eventually find at least one > user in an unfortunate (and in this case hard to debug) situation. So > the usual advice applies: > > a) Just warn about the missing PATH component without changing the PATH. after checking to see if the expected /bin is already present > b) Give the user an option to let the command run with a separate PATH. ++ > Indeed there might be other things that are missing in the environment, > so instead of just fixing up PATH you might consider using a wrapper > that the user can change. Maybe allow an env config file with comments, blank lines, env var definitions with values including embedded single and double quotes, env var refs, and one optional prefix command e.g. export, set, setenv, etc. which could be ignored when used without a definition e.g. "export PATH" rather than "export PATH=...". -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple