[Top][All Lists]

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

optimizing configure with resident sub-processes?

From: Lars J. Aas
Subject: optimizing configure with resident sub-processes?
Date: Mon, 18 Jun 2001 22:25:14 +0200
User-agent: Mutt/1.2.5i

I once tried to fork out a pipelined process into the background that
I could pipe input to and then read the output from (hopefully without
using files).  I never quite got it working (the I/O wouldn't block
when there was no data), but that may be my poor shell programming
skills.  I'm thinking something like: 

  ( exec sed -e 's/^dirname:<dirname-expr>' \
             -e 's/^uppercase:<uppercase-expr>' \
             ... \
             -e '/^quit$/ q' <<sed_in_fd> ><sed_out_fd> ) &

  echo "dirname:$0" >$sed_in_fd
  read basename <$sed_out_fd

I know the above doesn't work, but could it be done in some other,
hopefully portable, way?  Wouldn't it speed up configure by a lot if
we could apply it to the right sub-tasks?

I was even thinking the "resident" sub-process could be a shell that
looped over a read+switch/case expression to emulate functions, but as
I said, I never got the I/O quite working.

  Lars J

reply via email to

[Prev in Thread] Current Thread [Next in Thread]