aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/libposix/posix005.hs
blob: 4365eb52bdd58c7a95a030794d70a5450d943f0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

import System.IO
import System.Posix.Env

main = do
    hSetBuffering stdout NoBuffering
    term <- getEnv "TERM"
    maybe (return ()) putStrLn term
    setEnvironment [("one","1"),("two","2")]
    getEnvironment >>= print
    setEnv "foo" "bar" True
    getEnvironment >>= print
    setEnv "foo" "baz" True
    getEnvironment >>= print
    setEnv "fu" "bar" True
    getEnvironment >>= print
    unsetEnv "foo"
    getEnvironment >>= print
    clearEnv
    getEnvironment >>= print