Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Bash Manual

Bash Manual

Ratings: (0)|Views: 11|Likes:
Published by Zionysus
Manual for Linux Bourne Again Shell.
Manual for Linux Bourne Again Shell.

More info:

Published by: Zionysus on May 03, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/17/2014

pdf

text

original

 
Bash Reerence Manual
Reerence Documentation or BashEdition 4.1, or
Bash
Version 4.1.December 2009
Chet Ramey, Case Western Reserve UniversityBrian Fox, Free Sotware Foundation
 
This text is a brie description o the eatures that are present in the Bash shell (version4.1, 23 December 2009).This is Edition 4.1, last updated 23 December 2009, o 
The GNU Bash Reerence Manual 
,or
Bash
, Version 4.1.Copyrightc
1988–2009 Free Sotware Foundation, Inc.Permission is granted to make and distribute verbatim copies o this manual provided thecopyright notice and this permission notice are preserved on all copies.Permission is granted to copy, distribute and/or modiy this document underthe terms o the GNU Free Documentation License, Version 1.3 or any laterversion published by the Free Sotware Foundation; with no Invariant Sections,with the Front-Cover texts being “A GNU Manual”, and with the Back-CoverTexts as in (a) below. A copy o the license is included in the section entitled“GNU Free Documentation License”.(a) The FSF’s Back-Cover Text is: You are ree to copy and modiy this GNUmanual. Buying copies rom GNU Press supports the FSF in developing GNUand promoting sotware reedom.”Published by the Free Sotware Foundation59 Temple Place, Suite 330,Boston, MA 02111-1307USA
 
i
Table o Contents
1 Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
1.1 What is Bash?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2 What is a shell?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
2 Denitions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33 Basic Shell Features
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
3.1 Shell Syntax
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53.1.1 Shell Operation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53.1.2 Quoting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
63.1.2.1 Escape Character
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
63.1.2.2 Single Quotes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
63.1.2.3 Double Quotes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
63.1.2.4 ANSI-C Quoting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
63.1.2.5 Locale-Specic Translation
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
73.1.3 Comments
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
73.2 Shell Commands
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
73.2.1 Simple Commands
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
83.2.2 Pipelines
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
83.2.3 Lists o Commands
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
83.2.4 Compound Commands
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
93.2.4.1 Looping Constructs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
93.2.4.2 Conditional Constructs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
103.2.4.3 Grouping Commands
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
133.2.5 Coprocesses
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
143.3 Shell Functions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
143.4 Shell Parameters
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
153.4.1 Positional Parameters
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
163.4.2 Special Parameters
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
163.5 Shell Expansions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
173.5.1 Brace Expansion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
183.5.2 Tilde Expansion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
193.5.3 Shell Parameter Expansion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
193.5.4 Command Substitution
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
223.5.5 Arithmetic Expansion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
233.5.6 Process Substitution
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
233.5.7 Word Splitting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
233.5.8 Filename Expansion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
243.5.8.1 Pattern Matching
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
243.5.9 Quote Removal
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
253.6 Redirections
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
263.6.1 Redirecting Input
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->