Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCL: Disable bash command execution from tcl

Status
Not open for further replies.

ujin

Programmer
Apr 2, 2009
2
Can anyone advice how to disable bash command execution from the tcl.
E.g.

ast@ujin:~/Desktop$ tclsh
% ls
a.txt b.txt c.txt
% blin
invalid command name "blin"
%

I would like tclsh to throw error while executing "ls" command: {invalid command name "ls"}
Note that I don't want to disable all commands but some of them.

Thanks
 
I think you could do it within a script, by overriding the specific commands you want to disable. However, if I understand your question, you're asking about disabling them in the Tcl Shell. I don't think that's possible without modifying the code (of Tcl, itself) and recompiling.

May I ask why you would want to do this?

_________________
Bob Rashkin
 
I have a proc with name "a" which is launching/calling external command "ext_a".

Now I can call "a_1" and "ext_a_1" commands from the tclsh and I want tclsh to throw and error while calling "ext_a" command.

Thanks,
ujin
 
I don't see how you can do that except by overriding "exec". But, then you'd have no way of running any external commands.

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top