naming a file to hostname

I am running a script remotely to another client. after it runs it places the file in /tmp. I need the file in /tmp to be renamed to the local hostname. but when i set the variable it names the file to my local hostname. how do i fix that

Could you provide your code so that we may assist you?

While the script is running on the remote system, get the local hostname with "hostname", set variable like :
hostname_to_append = `hostname`
cp /tmp/file /tmp/file-$hostname_to_append
or replace cp with mv.
But you didn't specify OS and the script's language.

ok i will provide everything in detail.
the file i have is called sys_diag that i downloaded from SUN that someone wrote.
I that file on my machine in /var/tmp
when you run this script it will generate a .html file so this is my script
#!/bin/sh
list='01 02 03 04 05"
for x in $list ; do
echo $x
rcp test:/var/tmp/sys_diag test${x}:/tmp
rsh test${x} /tmp/sys_diag -o -u (-o and -u are switches for location)
once it runs it prompts for a location to store the file so i enter /tmp
(right here i need the rename of the .html file that is in tmp)
rsh test${x} mv /tmp/sysd_*/.html 10.200.xxx.xxx:/tmp
rsh test${x} rm -r /tmp/sysd_

/opt/firefox/firefox /tmp/*.html

basically i copy the script from my box to the remote box run it on the remote system. Then i just bring over the *.html file to my local machine and launch it in a browser. I know it all looks complicated but the above is the only scripting i really know for now. what i will do is create and database of all system information and update it once a month for other sites to view if they have questions about the system since they usually do. this will all be in .html web based

Solaris 9

Try this:
mv /tmp/filename.html /tmp/SomeImportantFile.test${x}.html