Script that takes in variables, and outputs to another text or script file

Ok, I sort of need to create a command files that will be ftped to another server to run.

I have some input variable that will need to be read, and then transformed into another script file. Here are some examples.

Server 1:
outputCmd.sh

passing in ./outputCmd.sh nh8oaxt Release_4_0 dwbe dev
----------------------------------------------------------
#!/bin/bash
uname = $1
tgt-directory = $2
app = $3
env = $4

execcmd = "exec prog emxSpinnerAgent.tcl "
echo "set context user" $uname "pass "$uname"; > runExecCmd.sh
echo "push context user creator"; > runExecCmd.sh

echo "execcmd "/spinner/$app"/"env"/"$tgt-directory"; > runExecCmd.sh
~
----------------------------------------------------------
Server 1:
runExecCmd.sh

This is what the command file should look like when it it finished.
----------------------------------------------------------
set context user nh8oaxt pass nh8oaxt;
push context user creator;

exec prog emxSpinnerAgent.tcl "/spinner/dwbe/dev/Release_4_0";
----------------------------------------------------------

I will take this runExecCmd.sh file, and ftp it to Server 2.

Thanks for any help.

Actually I figured it out myself.

Here is what I have:

#!/bin/ksh
echo $1 $2 $3 $4
user=$1
app=$2
env=$3
release=$4

echo "set context user $user pass $user;" > runCmdFile.txt
echo "push context user creator;" >> runCmdFile.txt
echo "exec prog emxSpinnerAgent.tcl \"/spinner/$app/$env/$release\";" >> runCmdFile.txt

orozcom