comm '! sort file1' '! sort file2'

chris chris at pixutl.UUCP
Wed Oct 15 00:43:07 AEST 1986


In article <7028 at elsie.UUCP>, ado at 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



More information about the Comp.unix.wizards mailing list