Advertisement
LazyShpee

Cat

Jun 12th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <sys/types.h>
  2. #include <sys/stat.h>
  3. #include <fcntl.h>
  4. #include <unistd.h>
  5.  
  6. int     main(int c, char *v[])
  7. {
  8.   while (c == 1 && read(0, *v, 1) && write(1, *v, 1));
  9.   while (c != 1 && *(++v) && (((*v)[0] == 45 && !(*v)[1] && !(c = 0)) ||
  10.                     ((c = open(*v, O_RDONLY))) != -1))
  11.     while ((read(c, *v, 1) && write(1, *v, 1)) || (c && close(c) && 0));
  12.   return (0);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement