Don't know if such a module exists or not, but what you're wanting to do sounds a bit dangerous to me. For example, if the following happens to show up in your text file: rm /* -rf
I'm sure you can find a combination of modules to help you achieve what you're wanting to do, but I personally would caution you to be sure to add one more requirement: sanitize the commands before running them to avoid running harmful commands such as the above example.
Of course, I guess there's a possibility that I might not know what I'm talking about here and may have an unrealistic fear of harmful commands being run in your described scenario. Perhaps this isn't related to Little Bobby Tables.