#!/bin/sh

cat > foo1.txt <<EOF
val
---
1.0
1.5
2.0
2.5
3.0
3.5
4.0
EOF

cat > foo2.txt <<EOF
val
---
1.5
2.5
3.5
EOF

funtable foo1.txt foo1.fits
(funindex foo1.fits val) > /dev/null

funtable foo2.txt foo2.fits
(funindex foo2.fits val) > /dev/null

if [ x$1 = x ]; then
  TOL=-1
else
  TOL=$1
fi

echo "./funjoin -t $TOL -j val foo1.fits foo2.fits stdout | fundisp stdin"
./funjoin -t $TOL -j val foo1.fits foo2.fits foo.fits
fundisp foo.fits
