#!/bin/sh
#
# Name:
# testfile
#
# Usage:
# ./testfile "/dir/and file to test for.txt"
#
# Notes:
# Quotes needed when testing for names with whitespace, etc.
# Be certain to:
# > chmod 700 testfile
# and perform any setup needed for ssh such as key generation and
# proper placment on the remote computer
#
hostname=mike@ram
echo $hostname
if ssh $hostname 'ls "'$1'" >/dev/null'; then
echo "file '"$1"' exists";
echo "byebye";
exit;
else
echo "file '"$1"' doesn't exist";
fi
echo "finito!"