Executing the result of a program as a shell script

I have a program that returns a shell script and I want to execute the script.

I'll use cat in my simple example, but wget is an example that is feasible.

$ # First setup a script
$ echo "ls
> df" > simple
$ # "cat simple" is now a program that returns a script
$ cat simple
ls
df
$ 

Now I want to execute the script returned from "cat simple". I am sure that there must be a way to do it, probably using nothing more than punctuation, but I haven't found it.

$ # This method works, but is ugly and needs write access to somewhere
$ cat simple > /tmp/somefile
$ . /tmp/somefile
< output of ls and df >
$ rm /tmp/somefile
$ 
$ # I want to do something like this:
$ `cat simple`
ls: cannot access df: No such file or directory
$ # Only it doesn't work

Does anyone have an idea of how to do this without writing to a temporary file?

Welcome to the forum .. Thanks for using code tags ..

To execute the simple file use some shell to run it ..

$ cat simple
ls
df
$ sh simple
< output of ls and df >
$

Thanks for the quick reply.

I don't want to run a file called simple. I only used "cat simple" as an example of a program which outputs a script. As I said wget might by a real-world application.

My application is actually a program that retrieves a script from the non-volatile RAM on a router!

If 'I want to execute the script returned from "cat simple"' isn't what you want to do, then I'm not clear on what your question actually is?

EDIT: Do you mean something like:

 myscript="df;ls"; eval $myscript