#!/bin/tcsh
if ("$1" == "") then
    echo "error: no query specified"
    exit 1
endif
if ("$2" == "") then
    set mode = "horiz"
else
    set mode = "$2"
endif
rm -f tempout
set sql = "$1"
echo "$sql" > tempsql
echo "\ngo\nquit\n" >> tempsql
sqsh -H gondor.informatics.jax.org:4025 -U kent -PJKent01 -m $mode -w 1000  -i tempsql -o tempout
if (-e tempout) then
    cat tempout
    rm -f tempout
endif    
