I have a variable called $a1 which maps to something like "http://servername proxy1 count http" and a lots of entries in a file on remote server.
If I have the following in my .sh script:
sed -i "\%$a1%d" mylog.txt
the line is deleted from mylog.txt. Great.
I'm trying now to remvoe this from a remote server too:
The echo $a1 | ssh ... redirects stdin - but nothing reads from it.
You can just redirect stdin with </dev/null ssh ... or close stdin with ssh -n ... ; that should have the same effect and not confuse anybody.