execute a script on test server from dev server

I need to execute a script from dev server which is located on Test server.I can use ftp to connect to dev server and from there how can i execute a command on test server.

Thanks

You can't execute commands over ftp unless you hack the ftp server to support this. Perhaps you could use ssh instead. Or if the command is well-defined, you could drop a particular file over ftp to signal to a process on the server to execute some predefined command; it would then clean out the signal file when the command has completed, and resume monitoring the directory where you drop the file.

All of these themes are well explored on this site; try the search facility.

I am able to execute a command with ssh option.But i am facing one problem.before executing a script i need to execute my .profile also.because i have some env varaibles which comes from .profile and the sript will use them.
Can any one of you please help me how can i do that.

ssh remote '. .profile; othercommands'

I'm a bit puzzled about the .profile comment, though. If ssh is correctly configured, it should run your .profile already.

I am getting the following error when i tried to exucte .profile in ssh command

stty: tcgetattr: Not a typewriter

You should not have stty in your .profile. Maybe ssh -t could help, though. Nevertheless, the warning just means stty didn't run, not that the whole command line failed.