[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Simple Unix utility?

Jim Pick <jim@jimpick.com> writes:

> Now I notice that "cut" seems to buffer everything up.
> $ tail -f /opt/linuxhq/livesite/var/log/access.log |  grep -v "gif" | cut -c1-175
> Is there another way around that?

cut doesn't buffers everything, grep is to blame.  If grep output to a
non-terminal (e.g. a pipe) it use buffers of 4k (don't remember the
correct value).  Unfortunatly, I don't know any way to get around
this.  Maybe you can use awk (or perl) to combine the functionality of
grep and cut in the above line.

BTW: A parameter to every program enforcing line-buffering instead of
block-buffering would be great. In this case grep would be called with
this parameter and everything works fine again.


I haven't lost my mind -- it's backed up on tape somewhere.
                                            Fortune Cookie
PGP Public key available

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: