[prev] [index] [next]

Exercise: Display Text

Write a program that emulates what cat does
  • if no command line args, read from stdin
  • treat each command line arg as a file name
  • for each file, copy its contents to stdout
Usage:

$ ./mycat < xyz
$ ./mycat xyz
$ ./mycat abc def ghi