On 3 May 2010 08:49, Daniel Fischer <[email protected]> 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:

iv...@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

iv...@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
[email protected]
IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to