-- printf ">>> %s\n" cmd
        -- hFlush stdout

waitFor :: Handle -> String -> IO ()
waitFor h str = do
        ln <- hGetLine h
        -- putStrLn $ "<<< " <> ln
        unless (str `isPrefixOf` ln) (waitFor h str)
        hFlush stdout
waitFor :: Handle -> String -> IO ()
waitFor h str = do
        ln <- hGetLine h
        -- putStrLn $ "<<< " <> ln
        unless (str `isPrefixOf` ln) (waitFor h str)
        hFlush stdout
waitFor h str = do
        ln <- hGetLine h
        -- putStrLn $ "<<< " <> ln
        unless (str `isPrefixOf` ln) (waitFor h str)
        hFlush stdout