Hey everyone. I am making a simple exec tcl script that only I can run with my eggie that will do little commands on my shell for me instead of logging into it to do a simple task. Anyway, my problem is, I can get it to run single word commands such as "uptime" and "pwd" but i can't get it to do anything that has a switch needed such as "ps -x". I get the following error:
1:48pm (BeBoo) .tcl exec ps -ux
1:48pm (optix) What? You need '.help'
The thing is, I'd like the output to go to the chan... Logging into my eggie just to run a command is just as bad as logging into the shell... I'd rather just be able to type "!exec ps -ux"
First off, try to avoid using the name "args" for any variable, unless explicitly intended to use it's special feature.
Secondly, you'll have to separate the arguments from the command in the cmd-line string, and pass them as a separate argument to exec.
I am using it's feature... It's in my proc... proc runit {nick uhost handle chan args} {
That works great! Now, because the commands that I will run, most of them are multi-lined and would like all the lines to appear in the output. How would I determine the end of the line? Would it be \n?
One other question... If I were to run a command such as 'who' by !exec who (which is not allowed on the shell), it outputs the "Permission denied" as a TCL error in the PL... Is there a way to detect if it's an error of some sort and have it output it to the channel anyway?