supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: prj@po.cwru.edu (Paul Jarc)
Cc: supervision@list.skarnet.org
Subject: Re: OT: svlogd-logprocessor with bash/multitee
Date: Wed, 13 Apr 2005 12:50:55 -0400	[thread overview]
Message-ID: <m34qea7h8a.fsf@multivac.cwru.edu> (raw)
In-Reply-To: <425D258D.9010708@zweipol.net> (Henrik Heil's message of "Wed, 13 Apr 2005 15:58:37 +0200")

Henrik Heil <hhml@zweipol.net> wrote:
> /usr/bin/multitee 0:6 0:7 \
> 7>&1 | sed s/test_stdin/test_fd7/

This can be simplified a bit:
multitee 0:6 0:1 | sed s/test_stdin/test_pipe/

> #!/bin/sh
> exec 6>&1
> /usr/bin/multitee 0:6 0:7 0:8 \
> 7>&1 | sed s/test_stdin/test_fd7/ \
> 8>&1 | sed s/test_stdin/test_fd8/
>
> # echo test_stdin | ./logproc.sh
>
> test_stdin
> [...programm does not return]

You have the second pipe set up between the two seds, but you want it
to be between multitee and the second sed:

{ { exec 7>&1 &&
    multitee 0:6 0:7 0:1 | sed s/test_stdin/test_pipe1/ >&6
  } | sed s/test_stdin/test_pipe2/
} 6>&1

bash has an extension that makes this easier:

multitee 0:1 \
  0:6 6> >(sed s/test_stdin/test_pipe1/) \
  0:7 7> >(sed s/test_stdin/test_pipe2/)


paul


      reply	other threads:[~2005-04-13 16:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-13 13:58 Henrik Heil
2005-04-13 16:50 ` Paul Jarc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34qea7h8a.fsf@multivac.cwru.edu \
    --to=prj@po.cwru.edu \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).