Version 21 of shell

Updated 2014-01-27 21:38:11 by pooryorick

The word shell has various meanings. The most common use of the word, on Unix, is a script interpreter implementing some language, and intended to be used interactively (in what some call command line mode) or by providing a script in a file and then executing it (a mode sometimes called batch) by a user.

Another more general definition is "The application that enables the user to navigate the file system and start applications." This definition also includes graphical shells like the CDE and KDE environments, the Windows Explorer or the MacOS Finder.

While technically, tclsh and wish applications are shells, in the first use of the word, Bourne, ksh, csh/tcsh, bash, zsh etc. are more commonly thought of as shells than are tclsh or wish. See Unix shells for more discussion of this use of the word.

The wiki page exec magic covers the topic of what type of first line magic one should put so that tclsh or wish (or whatever) gets invoked with the appropriate arguments.


http://en.wikipedia.org/wiki/Comparison_of_computer_shells discusses a comparison of various command line shells. Perhaps there is some tcl comperable add-on which would compare seriously to the others listed?


See Invoking tclsh or wish from Bourne Shell


itcl has a base widget called a shell: http://incrtcl.sourceforge.net/iwidgets/iwidgets/shell.gif

Docs can be found at http://incrtcl.sourceforge.net/iwidgets/iwidgets/shell.html and http://purl.org/tcl/home/man/iwidgets3.0/shell.n.html


Here's a proc to transform the contents of environment variables containing words in shell syntax into Tcl lists:

proc shtotcl {value {sh bash}} {
    set script "printf 'puts \[lrange \$argv 1 end]' | \$1 - $value"
    return [exec $sh -c $script - [info nameofexecutable]]}
}

Example:

shtotcl $env(LDFLAGS)

A more updated version of this code might be found at ycl::format::sh::shtotcl.