#!/bin/csh -f # Script to watch the acclog, filtering out my IP address, and translating # some known IP addresses to meaningful names. Useful as: # ssh remote_host acctail_filter_grep # Without the --line-buffered option, grep buffers its output. # So when used in a pipe, it may never actually emit anything out of # the end of the pipe until the data stream ends. That's fine for # batch processes, and it's more efficient. But, it's a problem # when feeding in live data like tail -F and expecting to see output # immediately. Especially when used with other pipe elements that # buffer their output (grep, sed, others?). Until all of the buffers # of the entire pipe fill up, you get no output. And if you kill the # process with Ctrl-C (since tail -F never ends), any buffered output # is lost. set grep = "grep --line-buffered" acctail_filter | $grep -i --color $*:q