How to enter commands to the command prompt in a program

Hey,
So I'm trying to write a program in unix to automate a process for my astrophysics research.
Basically I want the program to prompt the user for some information and store the entered string of text as a variable. I know how to do this.

This is where I need help:
Now lets say I have a command that needs to be run in the command prompt, and not in the program. How can I do that?

So for example I run the program. The program asks for the location of a certain file. The user enters the location and the program saves this text as some variable ($location).
I need the program to send the following to the command prompt: dmkeypar $location
is that doable?

---------- Post updated at 03:36 PM ---------- Previous update was at 03:18 PM ----------

Maybe if I tell you why I need to do this it will make more sense.

I have a bunch of sets of files that I want to manipulate in a similar way. Specifically I'm taking chandra satellite data files, and applying certain transformations and corrections to them. To do this I've created a recipe of the commands in UNIX I use to apply a particular transformation.
The whole recipe is about a hundred steps long. I would like to write a program so I dont have to keep entering the commands by hand, and that I only have to enter the file names or occasionally a number, which will be stored as a variable, the variable will be inserted into the recipee text, and the recipe text (with the user inputted file name) will be "entered" into the command prompt instead of back into the program.

---------- Post updated at 03:57 PM ---------- Previous update was at 03:36 PM ----------

I will be able to write my whole program easily if I can write this simple program.

When you the run the program it as you for an input.
So far the program would look like this:

#!/bin/sh

echo "Enter Location: \c"
read location

But next I want the program to input "location" into the command prompt, as if I had just opened the terminal and entered the contents of "location"

If I can achieve this I can do my whole program, since the only change will be that instead of entering merely the variable into the command prompt it enters some prescripted scripted with the variable (determined by the user input) embedded into the text.

This is all doable right?
Thanks in advance, if I can get this program to work it will save me so much time and let me actually get to the real research...

Like this??? :confused:

#!/bin/sh
read -p 'Location? :'
dmkeypar $REPLY

No that didnt work:(

Okay, then I'm not getting you at all.

Specifically this:

Could you provide some example of what you are expecting to run/see?

I think there was an error in the prev post Should be

#!/bin/sh
read -p 'Location? :' REPLY
dmkeypar $REPLY

or what is wrong with this ... why do you need to prompt for the location, just pass it in from the command line

#!/bin/sh
dmkeypar $1