GNU bug report logs - #6900
mktemp: want option to make a fifo

Previous Next

Package: coreutils;

Reported by: John Reiser <jreiser <at> bitwagon.com>

Date: Mon, 23 Aug 2010 15:41:01 UTC

Severity: normal

Tags: notabug

Merged with 6330

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 6900 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eric Blake <eblake <at> redhat.com>
Cc: John Reiser <jreiser <at> bitwagon.com>, 6900 <at> debbugs.gnu.org
Subject: Re: bug#6900: mktemp: want option to make a fifo
Date: Mon, 23 Aug 2010 16:49:59 -0700
On 08/23/2010 03:55 PM, Eric Blake wrote:
> We may be able to help you efficiently re-write your existing code into
> an equally manageable but more portable solution using existing tools,
> or it may help to convince us that the shorthand is truly useful.

I agree that a full example would be helpful.  Here's a quick sketch
of a shell script that solves the stated problem without using a
named fifo.  Without the full example it's hard to say whether
this approach would work well in the existing code.

#! /bin/sh
nl='
'
a() { for i in 0 1 2 3 4 5; do echo B$i; echo C$i; done; }
b1() {
  start_b2=$nl
  while read command
  do
    case $command in
    (C*) printf '%s\n' "$command" >&3;;
    (B*) printf '%s\n' "$start_b2$command"; start_b2=;;
    esac
  done
}
maybe_b2() { read line && sed 's/^./D/'; }
c() { sed 's/^/E/'; }

a | (b1 | maybe_b2) 3>&1 | c




This bug report was last modified 13 years and 350 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.