Cleanで
echo 'main = readFile "b.txt" >>= putStr . show . (\x->x*x*x) . read'> c.hs && echo 4 > b.txt && runghc.exe c.hs
これと同じことやってみ。