Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: cat as a builtin command



# dhs@xxxxxxxxxxxxx / 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



Messages sorted by: Reverse Date, Date, Thread, Author