Bash Hackers Wiki Frontpage

This wiki is intended to hold documentations of any kind about the GNU Bash. It's one of more applications of bash-hackers.org site.

The main motivation was to provide human-readable documentation and information to not force users to read every bit of the Bash manpage - which is PITA sometimes. The docs here are not meant as newbie tutorial, more as educational summary.

What would YOU like to see here? (editable without registration)

Stranger! Feel free to register and edit the contents. The registration is only there to prevent SPAM.

Since Bash version 4 will come soon, known changes will be merged into this documentation step by step. The logo :V4: indicates Bash version 4 features or behaviour. There is also a small text about the interesting changes: Bash 4 - a rough overview

Scripting and general information

Code snipplets

How to....

Bash syntax and operations

  • Expansions and substitutions:
Introduction to expansions and substitutions
{A,B,C} {A..C} Brace expansion
~/ ~root/ Tilde expansion
$FOO ${BAR%.mp3} Parameter expansion
`command` $(command) Command substitution
<(command) >(command) Process substitution
$((1 + 2 + 3)) $[4 + 5 + 6] Arithmetic expansion
... Word splitting
/data/*-av/*.mp? Pathname expansion
  • Compound commands:
Compound commands overview
Grouping
{ ...; } command grouping
( ... ) command grouping in a subshell
Conditionals
[[ ... ]] conditional expression
if ...; then ...; fi conditional branching
case ... esac pattern-based branching
Loops
for word in ...; do ...; done classic for-loop
for ((x=1; x<=10; x++)); do ...; done C-style for-loop
while ...; do ...; done while loop
until ...; do ...; done until loop
Misc
(( ... )) arithmetic evaluation
select word in ...; do ...; done user selections

Command Descriptions

This is a selection of builtin commands and command-like keywords.

A-G
coproc:V4: Co-processes
I-N
letarithmetic evaluation - an old fashioned way (Bash builtin)
mapfile:V4: Mapping lines of input to an array, also named readarray (Bash builtin)
O-T
printf“advanced echo” (Bash builtin)
readgetting input from stdin (Bash builtin)
setcontrol positional parameters and shell behaviour (Bash builtin)
shoptset/get shell options (Bash builtin)
testthe classic test command (Bash builtin)
U-Z

Dictionary

A list of expressions and words and their meaning is here.

Most wanted

Statistics for Month: May 2009
Rank Views Article
1 1711Small getopts tutorial (April: 1188)
2 1182The printf command (April: 904)
3 1105The classic test command (April: 1191)
4 948Bash 4 - a rough overview (April: –)
5 901Terminal codes (ANSI/VT100) introduction (April: 491)
6 620Handling positional parameters (April: 491)
7 571Editing files with the ed text editor from scripts (April: 602)
8 557Parameter expansion (April: –)
9 498Arithmetic expressions (April: –)
10 480The basics of shell scripting (April: 482)

May total views (all wiki pages): 24819 views (April: 25875)

Links

Bash related links

Assorted Shell links

Contact

If you have critics or suggestions, please feel free to send a mail using the contact form below. If you have quick suggestions, you can also use the Wishlist (editable by everyone!).

It also would be nice to drop a line when

  • it helped you
  • it didn't help you (something missing / unclear)
  • you like it
  • you don't like it
  • you found mistakes / bugs

Simply: Reader's feedback

Your Name :
Your Email :
Message :
Enter 'HUMAN' :

Please also see the imprint if you have problems with the site and its contents (legality, ...)!

Visits in irc.freenode.net, channel #bash ;-)

start.txt · Last modified: 2009/06/02 16:43 by thebonsai
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0