#!/bin/sh
# Tcl sees the next lines as an assignment to variable `kludge'.
# For sh, the two shifts cancel the effect of the set, and then we
# run scotty on this script.

set kludge { $*
    shift
    shift
    if test -x ../scotty ; then
      exec ../scotty -nf $0 $*
    else
      exec scotty -nf $0 $*
    fi
}

##
## Just call nslook for every arg in argv.
##

foreach arg $argv {
    if [catch {nslook $arg} res] {
	set res "<lookup failed>"
    }
    if {[string match \[1-9\]* $arg]} {
	puts "$arg\t$res"
    } else {
	puts "$res\t$arg"
    }
}

exit
