Linux Shell Scripting Tutorial v2.0.pdf
(
2641 KB
)
Pobierz
Linux Shell Scripting Tutorial
v2.0
Written by Vivek Gite <vivek@nixcraft.com>
and Edited By Various Contributors
PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information.
PDF generated at: Mon, 31 May 2010 07:27:26 CET
Contents
Articles
Linux Shell Scripting Tutorial - A Beginner's handbook:About
1
4
4
5
6
6
7
7
8
11
12
13
14
16
17
17
19
21
23
25
27
29
30
31
32
33
34
34
38
40
41
Chapter 1: Quick Introduction to Linux
What Is Linux
Who created Linux
Where can I download Linux
How do I Install Linux
Linux usage in everyday life
What is Linux Kernel
What is Linux Shell
Unix philosophy
But how do you use the shell
What is a Shell Script or shell scripting
Why shell scripting
Chapter 1 Challenges
Chapter 2: Getting Started With Shell Programming
The bash shell
Shell commands
The role of shells in the Linux environment
Other standard shells
Hello, World! Tutorial
Shebang
Shell Comments
Setting up permissions on a script
Execute a script
Debug a script
Chapter 2 Challenges
Chapter 3:The Shell Variables and Environment
Variables in shell
Assign values to shell variables
Default shell variables value
Rules for Naming variable name
Display the value of shell variables
Quoting
The export statement
Unset shell and environment variables
Getting User Input Via Keyboard
Perform arithmetic operations
Create an integer variable
Create the constants variable
Bash variable existence check
Customize the bash shell environments
Recalling command history
Path name expansion
Create and use aliases
The tilde expansion
Startup scripts
Using aliases
Changing bash prompt
Setting shell options
Setting system wide shell options
Chapter 3 Challenges
42
46
49
50
50
54
56
57
58
59
63
65
67
69
70
72
73
77
82
83
84
84
86
87
89
92
93
94
97
97
98
99
101
102
102
104
105
Chapter 4: Conditionals Execution (Decision Making)
Bash structured language constructs
Test command
If structures to execute code based on a condition
If..else..fi
Nested ifs
Multilevel if-then-else
The exit status of a command
Conditional execution
Logical AND &&
Logical OR ||
Logical Not !
Conditional expression using [
Conditional expression using <nowiki>[[</nowiki>
Numeric comparison
String comparison
File attributes comparisons
Shell command line parameters
How to use positional parameters
Parameters Set by the Shell
Create usage messages
Exit command
The case statement
Dealing with case sensitive pattern
Chapter 4 Challenges
110
112
114
115
117
119
123
126
127
127
133
135
139
141
143
146
148
150
153
155
157
157
158
159
160
161
162
164
166
167
169
170
170
171
173
174
Chapter 5: Bash Loops
The for loop statement
Nested for loop statement
The while loop statement
Use of : to set infinite while loop
The until loop statement
The select loop statement
Exit the select loop statement
Using the break statement
Using the continue statement
Command substitution
Chapter 5 Challenges
Chapter 6: Shell Redirection
Input and Output
Standard input
Standard output
Standard error
Empty file creation
/dev/null discards unwanted output
Here documents
Here strings
Redirection of standard error
Redirection of standard output
Appending redirected output
Redirection of both standard error and output
Writing output to files
Assigns the file descriptor (fd) to file for output
Assigns the file descriptor (fd) to file for input
Closes the file descriptor (fd)
Opening the file descriptors for reading and writing
Reads from the file descriptor (fd)
Executes commands and send output to the file descriptor (fd)
Chapter 6 Challenges
175
175
176
179
185
186
186
187
188
190
191
193
194
194
195
197
198
198
199
201
204
206
209
210
212
214
216
220
222
223
224
225
225
226
228
Chapter 7: Pipes and Filters
Linking Commands
Multiple commands
Putting jobs in background
Pipes
How to use pipes to connect programs
Input redirection in pipes
Output redirection in pipes
Why use pipes
Filters
Chapter 7 Challenges
Chapter 8: Traps
Signals
What is a Process?
How to view Processes
Sending signal to Processes
Terminating Processes
Shell signal values
The trap statement
How to clear trap
Include trap statements in a script
Use the trap statement to catch signals and handle errors
What is a Subshell?
Compound command
Exec command
Chapter 8 Challenges
Chapter 9: Functions
Writing your first shell function
Displaying functions
Removing functions
Plik z chomika:
musli_com
Inne pliki z tego folderu:
Learning Shell Scripting with Zsh.pdf
(11915 KB)
Advanced-bash-shell-scripting-guide.pdf
(2677 KB)
Pro Bash Programming.pdf
(5903 KB)
abs-guide_en.pdf
(2323 KB)
awk_FR.ppt
(1082 KB)
Inne foldery tego chomika:
3D Design - Programming
ActionScript
Actionscript - Flash - Flex - Air
Ada
ADO
Zgłoś jeśli
naruszono regulamin