Passing special characters in an SSH connection

I have a script like this


#!/bin/bash

hello=$1
echo `hostname` $hello
ssh gtint16 "echo $hello"

if I run this as #script.sh "hello''", it prints only hello on that ssh session and not the single quotes, but locally its printing hello''. I want the single quotes also to be printed in that ssh session. If I run #script.sh hello\'\', its printing in both places. But unfortunately I cant run it this way due to some reasons and dependencies. Is there any thing I can use inside the script to accept special characters and print in the ssh session.

try this ..

ssh host "echo \"$hello\""

Try

ssh gtint16 <<EOF
echo "$hello"
EOF

(tested, worked for me)

Use ssh's -T option if you get a message like

and want to get rid of it.