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

Re: fooling a non-"stdin redirection accepting" app (colortail)??



On 2012-11-24 08:59 +0100, Zenaan Harkness wrote:

> colortail is not a full replacement for tail - namely, it precludes pipe/|/stdin
>
> systemd-journalctl -f gives a non colorized output.
>
> Here's my failed attempt to fool colortail into accepting a bash file
> descriptor in order to pipe journal through colortail:
>
> Refer: http://www.tldp.org/LDP/abs/html/io-redirection.html

For programs which do not read standard input,
http://www.tldp.org/LDP/abs/html/process-sub.html is more interesting.
See also the "Process Substitution" paragraph in the bash manpage.

> SO, it comes to my mind, that there ought be a way to turn a bash file
> descriptor, into a file name, to fool colortail in some other way.
> Perhaps a /proc/$PID/fd/... or some such.

Exactly that is what process substitution achieves.

> Anyone know where to next, in the search for ultimate control over
> colortail, taming it into submission to the will of systemd-journald?

Probably "colortail -f <(systemd-journalctl -f)" will do the trick.

Cheers,
       Sven


Reply to: