<p>I'm not familiar with shell scripting, so I'm not sure how to do it or if it is possible.  If you can give me links or advice, that would be great.</p>
<p>What I want to do is:</p>
<ul>
<li><p>Create a file, simple text file
EX:</p>
<p>param1  (RANDOMVALUE)</p>
<p>Where randomvalue is a random number generated.</p>
</li>
<li><p>run a program with that file we just created and output to a file</p>
<p>./program filewejustcreated &gt; A</p>
</li>
</ul>
<p>The program has already been created and it takes a filename as a parameter, no need to worry about that stuff.</p>
<ul>
<li>run another program with the file we just created, the program already exists and out put it to a file</li>
</ul>
<p>./Anotherprogram filewejustcreated &gt; B</p>
<ul>
<li><p>run a diff comamand on A, B</p>
<p>diff A B</p>
</li>
</ul>
<p>Display what diff returns...</p>
<p>Thanks</p>
<p>[Edit] I am using shell: tcsh</p>

You have almost written the script already. The only missing thing is the random number; I'll do it with Perl. Here is a quick & dirty solution in sh (or bash; I'm presuming you're on a Linux/Unix system):
```
```
#!/bin/sh
perl -e 'print "TheWord (", int(rand(1000)), ")\n"' > tempfile
./program tempfile > A
./Anotherprogram tempfile > B
# rm tempfile  # this would delete 'tempfile' if uncommented
diff A B
```
```
Now save this in a file (say, script.sh) and in a shell execute:
```
```
chmod +x script.sh
```
```
to make it executable, and
```
```
./script.sh
```
```
to run it.