home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!mcsun!sunic!ugle.unit.no!news
- From: Harald.Eikrem@delab.sintef.no
- Subject: clever `cat' commmand?
- Message-ID: <1992Sep14.173218*Harald.Eikrem@delab.sintef.no>
- Sender: news@ugle.unit.no (NetNews Administrator)
- Organization: SINTEF DELAB, Trondheim, Norway.
- Date: 14 Sep 92 17:32:18
- Lines: 11
-
-
- For once, a question. Can anyone think of the simplest means of making
- a utility that behaves like `cat(1)', but exits with 0 if something went
- through it, otherwise 1? Preferrably a one-liner......
-
- I've tried: awk '{ s=1; print; }; END{ if(s) exit 0; exit 1; }'
-
- which is ok with a line oriented input stream, but not with a "binary"
- stream.
-
- ~~harald E.
-