Warp wrote:
> 'cat' is a program for concatenating files. It's used like:
>
> cat file1 file2 file3 > concatenated_files
>
> Your program does not fulfill this role.
>
> (Some people abuse 'cat' to concatenate one single file with nothing,
> but that doesn't mean that the role of 'cat' is anything else than
> concatenating files.)
Interesting. I thought it was for concatenating a file to stdout...
Alrighty then:
import System.Environment
main = do
args <- getArgs
mapM_ (\arg -> readFile arg >>= putStr) args
That seems to work.
I'm guessing the real cat program also has assorted command-line
switches as well though?
Post a reply to this message
|