-
Notifications
You must be signed in to change notification settings - Fork 2
/
eqgal
executable file
·58 lines (47 loc) · 997 Bytes
/
eqgal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
#
# eqgal
#
# Starbase Data Tables - An Ascii Database for UNIX
#
# copyright 2002 John B. Roll jr.
#
#
PATH=.:/bin:/usr/bin; export PATH
TABLELIB=$TABLELIB; export TABLELIB
TABLEFUN=""; export TABLEFUN
while [ $# -ge 1 ] ; do
case "$1" in
-i) shift; ifile="$1" ;;
-o) shift; ofile="$1" ;;
-*) echo "eqgal: unknown option"; exit 1 ;;
*) argv="$argv $1" ;;
esac
shift
done
if [ "$ifile" != "" ] ; then
exec < $ifile
fi
if [ "$ofile" != "" ] ; then
exec > $ofile
fi
table -p $argv '
BEGIN {
Init = 0
rcol = "ra"
dcol = "dec"
paramcheck("eqgal", "rcol|dcol")
}
!Init { __r = table_colnum(rcol)
__d = table_colnum(dcol)
if ( !__r ) printf("eqgal: no column \"%s\".\n", rcol) > "/dev/stderr"
if ( !__d ) printf("eqgal: no column \"%s\".\n", dcol) > "/dev/stderr"
if ( !__r || !__d ) {
exit 1
}
Init = 1
}
{ [ $__r, $__d ] = eqgal($__r, $__d); print }
include ../tablefun/paramcheck
include ../tablefun/table_colnum
'