From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11577 invoked by alias); 29 Aug 2014 13:20:59 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19043 Received: (qmail 22560 invoked from network); 29 Aug 2014 13:20:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Date: Fri, 29 Aug 2014 15:20:55 +0200 From: Roman Neuhauser To: Dirk Heinrichs Cc: zsh-users@zsh.org Subject: Re: cat as a builtin command Message-ID: <20140829132055.GP4075@isis.sigpipe.cz> References: <54007106.3010305@recommind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54007106.3010305@recommind.com> User-Agent: Mutt/1.5.23 (2014-03-12) # dhs@recommind.com / 2014-08-29 14:24:38 +0200: > Am 29.08.2014 um 03:40 schrieb Izumi Natsuka: > > > Hello, I'm going to write a shell function that provides a basic > > functionality(print the content of a file or stdin) of cat[0], in > > order to avoid forking too many process when I call it in a loop[1]. > > I try to avoid cat alltogether, as many uses belong to the "Useless use > of cat" category, like this one: > > > > > $ cat archlinux-2012.09.07-dual.iso | wc -c > > 39 > > Could also be "wc -c archlinux-2012.09.07-dual.iso". definitely, but that doesn't fit the no-fork(2) restriction; i understand the OP used wc(1) simply to demonstrate the defect in his implementation. -- roman