home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:12864 comp.unix.programmer:4467
- Path: sparky!uunet!underg!max
- From: max@underg.UUCP (Max Cray)
- Newsgroups: comp.lang.c,comp.unix.programmer
- Subject: I/O With Unix/C
- Message-ID: <ZcB7PB1w164w@underg.UUCP>
- Date: Thu, 27 Aug 92 12:22:58 EDT
- Organization: Underground Computing Foundation
- Lines: 34
-
- Help!
-
- I am trying to do the most basic file I/O on a couple of unix machines (HP835,
- and Sequent S27), and I can not get it to work. For example:
-
- #include <stdio.h>
- main()
- {
- int c;
-
- while (c = getchar() != NULL)
- putchar(c);
- }
-
- On a DOS machine you just compile it, and it works. When I compile it on
- a unix machine, it compiles and runs, but I can't seem to redirect input
- and output through it.
-
- ls -l | myfilter > outfile.tmp
-
- If I type the following command it runs, but it still expects the I/O to
- come from the keyboard, and go to the screen.
-
- What am I missing?
-
- Please mail replies.
-
- thanks,
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- -= Max Cray =-
- Net: underg%max@uunet.uu.net Don't be afraid;
- UUCP: ...!uunet!underg!max just believe.
- CI$: 76334,2203
-