Version 24 of shell

Updated 2014-07-22 09:58:56 by dbohdan

The word shell has various meanings. On Unix systems, a shell is an interactive interpreter for some language, providing a command-line as a user user interface to the the system. Such shells usually can also operate in batch mode, reading a file an interpreting the contents as a script to be executed.

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.


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?


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.

Advantages of Tcl for Shell Scripting

Shells in the csh family are known to be unsuitable for any serious scripting, but shells in the sh family are often used extensively for the purpose. Tcl is a better choice.

TODO: Add the details

See Also