env and PATH
Marco Atzeri
marco.atzeri@gmail.com
Sat Jan 11 20:56:23 GMT 2025
On 20/12/2024 17:51, Federico Kircheis via Cygwin wrote:
> Hello to everyone,
>
>
> I've noticed that env seems to handle the environment variable PATH in a
> particular way
>
>
> -----
> > cd /d;
> > env -i PATH='C:\Windows;C:\Windows\system32;' /c/Windows/System32/
> WindowsPowerShell/v1.0/powershell.exe
> # in the powershell instance
> echo $env:PATH
> C;D:\Windows;C;D:\Windows\system32;
> ----
env is a Cygwin program so it will be better to set the PATH POSIX style
----------------------------------
$ env -i PATH="/cygdrive/c/Windows:/cygdrive/c/Windows/system32"
/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements!
https://aka.ms/PSWindows
PS D:\cygwin64\home\marco> echo $env:PATH
echo $env:PATH
C:\Windows;C:\Windows\system32
-------------------------------------
the PATH is correctly transformed from POSIX to Windows for the
invocation of the powershell
Regards
Marco
More information about the Cygwin
mailing list