6

Background SSH using here document

view full story
linux-howto

http://www.unix.com – I'm trying to use Here documents to pass several commands to a remote server over SSH. However I'm having problems. The code is as follows: Code: nohup ssh $i_hostname exec /usr/bin/ksh -s << EOF >> $AS_STOPSAP_LOG & echo $i_instname; ps -ef | grep name | grep ${i_instname} |grep -v grep   proc=$(ps -ef | grep name | grep ${i_instname} |grep -v grep | awk '{print $2}')   $( for j in $STARTSRV do echo loop checking item $j kill -9 $j; echo "Killed $j" done ) EOF The problem seems to start with the fact that the "proc" variable does not seem (HowTos)