[Haskell-cafe] Happy: PATH issue

Ivan Miljenovic ivan.miljenovic at gmail.com
Sun May 2 20:12:20 EDT 2010


On 3 May 2010 08:49, Daniel Fischer <daniel.is.fischer at web.de> wrote:
> Am Montag 03 Mai 2010 00:28:31 schrieb Ivan Lazar Miljenovic:
>> bash expands it when you use it within bash, but when it's used within
>> another program this might not be the case (since the PATH is just a
>> String after all).
>
> But does that string contain any '~'s?
> I think not (unless quoted).
> I believe the string that is assigned to PATH is already expanded (if you
> have
>

I tried it:

ivanm at feitpc02 ~ $echo $PATH
~/tools/bin/:/home/ivanm/emacs/bin/:/home/ivanm/.cabal/bin/:/home/ivanm/ghc/bin/:/usr/bin/:/home/ivanm/tools/bin/:/home/ivanm/emacs/bin/:/home/ivanm/.cabal/bin/:/home/ivanm/ghc/bin/:/usr/bin/:/home/ivanm/tools/bin/:/home/ivanm/emacs/bin/:/home/ivanm/.cabal/bin/:/usr/bin/:/home/ivanm/ghc/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

ivanm at feitpc02 ~ $ghc -e 'System.Environment.getEnv "PATH"'
"~/tools/bin/:/home/ivanm/emacs/bin/:/home/ivanm/.cabal/bin/:/home/ivanm/ghc/bin/:/usr/bin/:/home/ivanm/tools/bin/:/home/ivanm/emacs/bin/:/home/ivanm/.cabal/bin/:/home/ivanm/ghc/bin/:/usr/bin/:/home/ivanm/tools/bin/:/home/ivanm/emacs/bin/:/home/ivanm/.cabal/bin/:/usr/bin/:/home/ivanm/ghc/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

whilst variables might get expanded, ~ isn't.

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list