Re: How to handle length limit of PATH environment variable
- Date: Thu, 5 Apr 2018 10:26:40 -0600
- From: Brian Inglis <Brian.Inglis@xxxxxxxxxxxxxxxxxx>
- Subject: Re: How to handle length limit of PATH environment variable
On 2018-04-05 04:05, Wolf Geldmacher wrote:
> On 05.04.2018 11:19, Peter Bauer wrote:
>> i was bitten by the length limit of the PATH variable of 4095 characters (see
>> ) and could not find a way around it. This means i have a lot of software
>> packages in different directories and each of them adds itself to the PATH so
>> one can run the executables and have the shared libs available. Under Windows
>> there is the "short path workaround" but what to do under Cygwin?
>> Creating links with shorter names to the directories is not feasible since
>> there may be different users and different directories per user.
>> Any ideas?
> On Unix (though not on cygwin) I've previously solved such issues by writing a
> script that collects symlinks to the contents of some list of directories in a
> few (system and/or user specific) directories. These few directories then take
> the place of the list.
> The script will need to be re-run whenever there are changes to the directories
> on the list, but that can usually be automated.
Under Cygwin, I ln -rs custom local Cygwin scripts and exes in:
added at the head of the Cygwin PATH,
and to keep them separate from Cygwin components, put custom local Windows user
scripts and exes in:
added after all Cygwin dirs in PATH, before other Windows dirs.
I keep Windows system specific scripts e.g. .cmd, .reg and exes requiring
separate from the unprivileged components.
I add /usr/local/bin/ to the head of the cron PATH, and /home/.../bin/ to the
tail of the cron PATH, so everything used in cron jobs is there; I run
everything in Scheduled tasks from C:\usr\local\bin\ for similar reasons.
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple