POV-Ray : Newsgroups : povray.off-topic : how to scheme a cat up? : Re: how to scheme a cat up? Server Time
5 Sep 2024 09:25:42 EDT (-0400)
  Re: how to scheme a cat up?  
From: Invisible
Date: 19 Aug 2009 04:40:32
Message: <4a8bba80$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.