Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!think!husc6!wjh12!pixel!pixutl!chris From: chris@pixutl.UUCP (chris) Newsgroups: net.unix-wizards Subject: Re: comm '! sort file1' '! sort file2' Message-ID: <38@pixutl.UUCP> Date: Tue, 14-Oct-86 10:43:07 EDT Article-I.D.: pixutl.38 Posted: Tue Oct 14 10:43:07 1986 Date-Received: Fri, 17-Oct-86 08:12:36 EDT References: <830003@hpcnoe.UUCP> <35@pixutl.UUCP> <3724@umcp-cs.UUCP> <7028@elsie.UUCP> Organization: xePIX Inc., Nashua, N.H. Lines: 28 Summary: fifo's In article <7028@elsie.UUCP>, ado@elsie.UUCP (Arthur David Olson) writes: > > Even if a normal can create a fifo, it may not be the wisest thing to do. > Think of the havoc that results if I put a > sort "$1" > ~/fifo & sort "$2" | comm - ~/fifo > command into a shell script (named, for example, "scomm") and then, > six months from now when I've forgotten the implementation details, > type in > scomm firstfile secondfile > results & > scomm thirdfile fourthfile > moreresults & > Think of the havoc that would be created if 6 months from now you forgot the implementation details of 'rm -r'... You can create temporary fifo's if you want to fix that problem. [ ${#} -ne 2 ] && { echo "Usage ${0} file1 file2"; exit 1; } trap "rm -f /tmp/fifo$$" 0 1 2 3 /etc/mknod /tmp/fifo$$ p || { echo "can't create fifo" ; exit 1; } sort "${1}" > /tmp/fifo$$ & sort "${2}" | comm - /tmp/fifo$$ Chris -- Chris Bertin : (603) 881-8791 x218 xePIX Inc. : 51 Lake St : {allegra|ihnp4|cbosgd|ima|genrad|amd|harvard}\ Nashua, NH 03060 : !wjh12!pixel!pixutl!chris