Main Content

Shortened interactive commands

Archive - Originally posted on "The Horse's Mouth" - 2005-10-11 13:44:32 - Graham Ellis

In Tcl, if you're working in interactive mode you can abbreviate the commands you type in, as long as your commands remain unique. So instead of puts you can write put or even pu ... but if you try to run just the p command you'll get

% p hello
ambiguous command name "p": package pid proc puts pwd
%


If you're running from a a file of Tcl commands, though, you need to specify the command name in full - puts.