Shell script not able to zip the file using gzip

Hi all,

I am calling Temp.sh and it is has simple line

$gpath=`which gzip`
$gpath $FilePath/My_temp.log

if I run this script, logging to server then its works fine. But when I send this script over the SSH it does not work at it. gzip is command is not execute.

I am using

gzip 1.6
Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Jean-loup Gailly. 

Is there is any solution for it? Why is this happening?

thanks
--girija

I'm pretty sure above script does NOT run unless the and $ be removed.

Please share your ssh command line so we can analyse and help.

Quite sure the is supposed to make it bold, while the (first) $ indicates it was run as user.
EDIT: But you're right, better not just assume this.