#!/bin/sh
################################################################################
# Copyright (c) 2012-2016 VMware, Inc. All rights reserved.
################################################################################

# Look for psql.bin in the same dir as this script
psql_bin_dir=$(dirname $0) || { echo Unable to determine parent dir of $0; exit 1; }
test -x $psql_bin_dir/psql.bin || { echo Unable to find executable $psql_bin_dir/psql.bin ; exit 1; }
tcap=$psql_bin_dir/../etc/termcap
# Check termcap in ../etc (x86_64) or ../../etc (i686)
test -e $tcap || tcap=$psql_bin_dir/../../etc/termcap
TERMCAP=$tcap $psql_bin_dir/psql.bin "$@"
