blob: a53182971ab5ddbbcad7a9aa6b6351b3aa918110 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import Posix
import IO
main =
hSetBuffering stdout NoBuffering >>
getEnvVar "TERM" >>= \ term ->
putStrLn term >>
setEnvironment [("one","1"),("two","2")] >>
getEnvironment >>= \ env ->
print env >>
setEnvVar "foo" "bar" >>
getEnvironment >>= \ env ->
print env >>
setEnvVar "foo" "baz" >>
getEnvironment >>= \ env ->
print env >>
setEnvVar "fu" "bar" >>
getEnvironment >>= \ env ->
print env >>
removeEnvVar "foo" >>
getEnvironment >>= \ env ->
print env >>
setEnvironment [] >>
getEnvironment >>= \ env ->
print env
|