runCompound :: OnErr -> CompoundStatement -> Shell ExitCode
runCompound b (For var list cs) =
    do ws <- expandWords list
       ecs <- forM ws $ \w -> do setEnv var w
                                 runCommands' b cs
       return $ if null ecs
                then ExitSuccess
                else head $ reverse $ ecs
runCompound :: OnErr -> CompoundStatement -> Shell ExitCode
runCompound b (For var list cs) =
    do ws <- expandWords list
       ecs <- forM ws $ \w -> do setEnv var w
                                 runCommands' b cs
       return $ if null ecs
                then ExitSuccess
                else head $ reverse $ ecs
runCompound b (For var list cs) =
    do ws <- expandWords list
       ecs <- forM ws $ \w -> do setEnv var w
                                 runCommands' b cs
       return $ if null ecs
                then ExitSuccess
                else head $ reverse $ ecs