in reply to Using Exec command with parameters

Your code is using single quotes, which won't interpolate variables (so you should be seeing $p1 and $p2 as you parameters instead of blank). Either use double-quotes, or else use the multi-argument form of exec.