#!/bin/csh -f
#
# cdf - convert a points file into a cdf-style file
#
# usage:
#  cdf file...
# sorts all files together, assigns distribution values, and puts
# it on the stdout. If no files are given the stdin is used.
#
# $Id: cdf,v 2.0 94/07/17 18:33:41 dfk Exp $

onintr cleanup
set data=/tmp/cdfdata$$

# Sort won't take exponential notation for numbers, so we use awk to 
# force it into %f format, as well as catting files. 
awk '{printf "%.10f\n", $1}' $* | sort -n > $data
set n=`stats n < $data`
dm x1 INLINE/$n < $data

cleanup:
rm -f $data


