You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{-# LANGUAGE OverloadedStrings #-}
importqualifiedShellyasShimportqualifiedSystem.EnvironmentasEnvmain::IO()
main =doprint"PATH according to Shelly"
(Sh.shelly $Sh.get_env "PATH") >>=printprint"PATH according to System.Environment"Env.getEnv "PATH">>=print
I'd expect that results of both Sh.get_env "PATH" and Env.getEnv "PATH" are the same (modulo Maybe), however to my surprise they are not.
H:\shelly>stack ghc Test.hs && test
Run from outside a project, using implicit global config
Using resolver: lts-3.5 from global config file: C:\s\global\stack.yaml
Continuing despite missing tool: msys2
[1 of 1] Compiling Main ( Test.hs, Test.o )
Linking Test.exe ...
"PATH according to Shelly"
Nothing
"PATH according to System.Environment"
"C:\\CUDA\\Toolkit\\bin;C:\\CUDA\\Toolkit\\libnvvp;C:\\thingsInPath;C:\\Python27\\;C:\\Python27\\Scripts;C:\\Perl64\\site\\bin;C:\\Perl64\\bin;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Users\\mwurb_000\\AppData\\Roaming\\cabal\\bin;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\Program Files (x86)\\Git\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.0\\;C:\\Program Files (x86)\\CMake\\bin;C:\\Program Files (x86)\\QuickTime\\QTSystem\\;C:\\Program Files\\Microsoft SQL Server\\120\\Tools\\Binn\\;C:\\Program Files (x86)\\Subversion\\bin;C:\\Program Files (x86)\\Skype\\Phone\\;C:\\Program Files\\Microsoft DNX\\Dnvm\\;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\TortoiseGit\\bin;C:\\Program Files\\OpenVPN\\bin;C:\\Users\\mwurb_000\\AppData\\Local\\Programs\\minghc-7.8.4-x86_64\\switch;C:\\Ruby21-x64\\bin;C:\\Users\\mwurb_000\\AppData\\Local\\atom\\bin;C:\\ProgramData\\chocolatey\\bin;"
After some more experiments I think I got why Shelly cannot get PATH. On my Windows machine this environment variable is named Path. Apparently Shelly's get_env is case-sensitive. It should not be.
Because of that not only getting the environment fails but it also breaks functions like which.
The text was updated successfully, but these errors were encountered:
Please consider the following program:
I'd expect that results of both
Sh.get_env "PATH"
andEnv.getEnv "PATH"
are the same (modulo Maybe), however to my surprise they are not.After some more experiments I think I got why Shelly cannot get
PATH
. On my Windows machine this environment variable is namedPath
. Apparently Shelly'sget_env
is case-sensitive. It should not be.Because of that not only getting the environment fails but it also breaks functions like
which
.The text was updated successfully, but these errors were encountered: