I basically wish to seek, search and follow a growing log file after passing it through a sed
filter. I figured I need to follow a file with tail -f
pipe it to sed
and then pipe that to less
. For testing, I first tried combining tail -f
and less +F
to no avail:
tail -f file | less +F
— less doesn't run before one presses Ctrl+C to stop tail's following.less
options-B -b 1
do not help.less +F -f <(tail -f file)
exhibits the same behavior.
If anyone knows a better/simpler solution than what I figured out in the end, I'd appreciate it.
Best Answer
Since piping directly didn't work, I tried connecting
tail -f
,sed
andless +F
via a temporary file. Ended up with the followingwhich does the job, though it's more complicated than I'd like. Note that my SunOS
tail
doesn't understand--pid
, so I manually kill thetail
pipeline.