Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Trim leading space from PATH

Dec
32
0
Before upgrading to TCC 30, I have used 4NT 5.0 (since 2004) with a complex setup for my PATH.
Like f:\gv\4nt\environ.nt with:

Code:
MASTER_PATH=f:\gv\bat;^
            f:\util;^
            f:\util\zip-tools;^
            f:\util\NirSoft2;^
            f:\util\WinFlex;^
            f:\util\nant-0.92\bin;^
            %MINGW32\bin\CMake3-24\bin;^
            %MINGW32\src\Sound\FFmpeg\bin;^
            %MINGW32\src\inet\Crypto\OpenSSL\bin;^

etc. And reloading it with env /r f:\gv\4nt\environ.nt.

MASTER_PATH
then gets assigned to PATH (in another .btm-file) and further modified depending on
which GNU-C compiler I want to use etc.

Now with TCC I have to write it in this IMHO ugly way (no leading spaces):
Code:
MASTER_PATH=f:\gv\bat;^
f:\util;^
f:\util\zip-tools;^
f:\util\NirSoft2;^
f:\util\WinFlex;^
f:\util\nant-0.92\bin;^
%MINGW32\bin\CMake3-24\bin;^
%MINGW32\src\Sound\FFmpeg\bin;^
%MINGW32\src\inet\Crypto\OpenSSL\bin;^

since I fail to get the a set PATH=%@trimall[%PATH] to work correctly.
It e.g. replaces c:\Program Files into c:\ProgramFiles. How do I do this?
 
What is ENV?

Code:
v:\> type environ.nt
MASTER_PATH=c:\one\two;^
            c:\three\four;^
            c:\five\six

v:\> set /r environ.nt

v:\> set mas*
MASTER_PATH=c:\one\two;c:\three\four;c:\five\six
 
> What is ENV?

env`? It's a POSIX program AFAIK.

But I fixed it with this:
Code:
iff %_cmdproc. == TCC. then
  set PATH=%@replace[; ,;,%@trimall[%path]]
endiff
 
You may want to take advantage of the new and upgraded PATH command.

Several changes since 4NT 5.0

There is also the DIRENV command,
introduced in v30,
which configures the environment on a per-directory basis.

Joe
 

Similar threads

Back
Top