I am trying to cat on a file located on remote server and assign it to remote variable.
I have both local and remote variables. Running below script from local. test.sh
J_NAME=XXX2
J_IP=XXX
ssh $J_IP "ps auxw |grep java | grep -v grep |grep $J_NAME | awk '{print \$2}'>/tmp/$J_NAME.pid;
chmod u+rwx /tmp/$J_NAME.pid;
pid= cat /tmp/$J_NAME.pid;
echo \$pid; kill -3 \$pid >>/tmp/$J_NAME.log"
I can print remote value by doing cat on remote /tmp/$J_NAME.pid but not able to store in remote variable and do some work on that variable.
I understand concept of `,",',\. Looks like I am missing something