Updated 2015-01-01 06:52:00 by pooryorick

bash is Unix shell in the Bourne shell family. The name is an acronym for Bourne-Again SHell, which is a slight pun on the old Bourne shell sh.

Attributes  edit


Reference  edit

official reference
Bash FAQ
the official FAQ
Advanced Bash Scripting Guide, by Mendel Cooper
An in-depth exploration of the art of shell scripting
Bash FAQ
by denizens of the freenode #bash channel
Bash Pitfals
also by the freenode #bash channel crowd

Description  edit

There seems to be no Tcl Heritage directly linked to bash (at least not yet), but the languages are similar in many ways. The quoting scheme used in Tcl was (almost certainly) influenced by shell languages such as Bash.

Programmers in Tcl have been confused at times by the Tcl quoting scheme because they expected Tcl quoting to operate the same way as Bash or other shell-language quoting, so many Tcl programmers would probably do well to know the pitfalls and frequently asked questions about Bash. Also, Bash commands can be invoked through Tcl via exec and friends, in which case it will probably help to be familiar with the differences. In particular, Bash tends to automatically expand wild cards such as *.txt, whereas in Tcl such expansions will typically require an explicit glob command.

Bug: syntax error near unexpected token  edit

With newer version of Bash, (3.0 and up), When building older Tcl versions or Tcl extensions based on TEA ./configure might fail with an error resembling:
./configure: line 7624: syntax error near unexpected token `)'

The cause of this error is a typo in tcl.m4 and the generated configure file. Previous versions of bash accepted the incorrectly quoted version, but newer versions will error out. The solution is to create a new configure file with the correct quoting:
cp configure{,.orig} && sed "s/relid'/relid/" configure.orig > configure

The typo has been fixed from Tcl 8.4.14. Extensions might exhibit this problem for quite some time to come.

The Joy of Bash  edit

Feature Request: export extglob from environment
for a good time, take the ability to export functions via environment variables, sprinkle in shell settings that change the syntax of function definitions, and then try to run other executable bash scripts that aren't expecting that syntax. Or just preserve your sanity by using Tcl instead.

See Also  edit

Playing Bourne shell
ways to port bash scripts to Tcl.