I want to run testcmd.sh
on remote host (Testhost) using the following command:
ssh test@Testhost 'bash -s' < /test/testcmd
But I get the below error :
!!!!!Running MASTERCMD!!!!!
bash: line 31: /test/PROCESSLIST: No such file or directory
I dont want to have the PROCESSLIST
file placed locally on the Testhost. How can I overcome this?
Cat Testcmd is below:
echo "!!!!!Running MASTERCMD!!!!!"
RC=0
while read proc; do
if (( 0 == $(ps -ef | grep -v grep | grep -c /test/$proc) )); then
echo "!!!!! $proc down on TU !!!!!"
RC=1
else
echo "!!!!!! $proc is still running on TU!!!!!"
fi
#echo "Not checked"
done < /test/PROCESSLIST
cat /test/PROCESSLIST |
? At first glance that may help.