Originally Posted by hasan_sust
Thanks for the link. But it didn't served my purpose.
Please see my code and mention How I implement this on my code.
Try putting a backslash (\) in front of the $, like
that normally 'escapes' characters, and treats them as such, rather than as a control-character. Also, putting a password into ANY script is VERY insecure. Since you're using SSH, I'd strongly suggest using a key-swap, so you can do passwordless-logins, and yet remain secure. It will also greatly simplify your script, too....