1 import LibSystem(getArgs)
3 main = getArgs >>= \ [user,host] ->
4 let username = (user ++ "@" ++ host) in
5 openFile username ReadWriteMode >>= \ cd ->
6 hSetBuffering stdin NoBuffering >>
7 hSetBuffering stdout NoBuffering >>
8 hSetBuffering cd NoBuffering >>
9 hPutStr cd speakString >>
12 speakString = "Someone wants to speak with you\n"
15 (hReady cd >>= \ ready ->
16 if ready then (hGetChar cd >>= putChar)
19 hReady stdin >>= \ ready ->
20 if ready then (getChar >>= hPutChar cd)