tech-userlevel archive

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

Re: Feed facility/priority to logger(1) via stdin - desirable extension or bad idea?



On Fri, 7 Oct 2022 at 14:19, Matthias Petermann <mp%petermann-it.de@localhost> wrote:
>
>
> - Can what I have in mind already be solved (differently or more
> elegantly) with existing tools from the base system?
>
It's not elegent, but depending on your shell you can abuse tee to do
something like:

$ echo -e "alert|alert thing\ninfo|less important\n" |
 tee >(grep "^info|" | cut -c6- | logger -puser.notice) |
 grep "^alert|" | cut -c7- | logger -plocal0.notice

cheers,

Ian


Home | Main Index | Thread Index | Old Index