没有合适的资源?快使用搜索试试~ 我知道了~
linux shell script tutorial_v2_r5.pdf
需积分: 9 18 下载量 172 浏览量
2010-11-22
20:12:32
上传
评论
收藏 1.89MB PDF 举报
温馨提示
试读
245页
linux shell script tutorial_v2_r5.pdf
资源推荐
资源详情
资源评论
PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information.
PDF generated at: Thu, 08 Oct 2009 13:15:08 CET
Linux Shell Scripting Tutorial
v2.0
Written by Vivek Gite <vivek@nixcraft.com>
Contents
Articles
Linux Shell Scripting Tutorial - A Beginner's handbook:About 1
Chapter 1: Quick Introduction to Linux
4
What Is Linux 4
Who created Linux 5
Where can I download Linux 6
How do I Install Linux 6
Linux usage in everyday life 7
What is Linux Kernel 7
What is Linux Shell 8
Unix philosophy 9
But how do you use the shell 10
What is a Shell Script or shell scripting 11
Why shell scripting 12
Chapter 1 Challenges 14
Chapter 2: Getting Started With Shell Programming
15
The bash shell 15
Shell commands 16
The role of shells in the Linux environment 19
Other standard shells 20
Hello, World! Tutorial 21
Shebang 22
Shell Comments 24
Setting up permissions on a script 25
Execute a script 26
Debug a script 27
Chapter 2 Challenges 28
Chapter 3:The Shell Variables and Environment
29
Variables in shell 29
Assign values to shell variables 33
Default shell variables value 34
Rules for Naming variable name 35
Display the value of shell variables 36
Quoting 39
The export statement 41
Unset shell and environment variables 42
Getting User Input Via Keyboard 42
Perform arithmetic operations 44
Create an integer variable 46
Create the constants variable 47
Chapter 3 Challenges 48
Chapter 4: Conditionals Execution (Decision Making)
49
Bash structured language constructs 49
Test command 51
If structures to execute code based on a condition 52
If. . else. . fi 54
Nested ifs 57
Multilevel if- then- else 58
The exit status of a command 59
Conditional execution 61
Logical AND && 62
Logical OR || 63
Logical Not ! 64
Conditional expression using [ 65
Numeric comparison 66
String comparison 67
File attributes comparisons 68
Shell command line parameters 73
How to use positional parameters 75
Parameters Set by the Shell 76
Create usage messages 77
Exit command 79
The case statement 81
Dealing with case sensitive pattern 85
Chapter 4 Challenges 87
Chapter 5: Bash Loops
88
The for loop statement 88
Nested for loop statement 93
The while loop statement 95
Use of : to set infinite while loop 99
The until loop statement 101
The select loop statement 102
Exit the select loop statement 106
Using the break statement 108
Using the continue statement 110
Command substitution 113
Chapter 5 Challenges 115
Chapter 6: Shell Redirection
116
Input and Output 116
Standard input 117
Standard output 119
Standard error 120
Empty file creation 121
/ dev/ null discards unwanted output 122
Here documents 123
Here strings 125
Redirection of standard error 126
Redirection of standard output 128
Appending redirected output 129
Redirection of both standard error and output 129
Writing output to files 130
Assigns the file descriptor (fd) to file for output 132
Assigns the file descriptor (fd) to file for input 133
Closes the file descriptor (fd) 134
Opening the file descriptors for reading and writing 134
Reads from the file descriptor (fd) 135
Executes commands and send output to the file descriptor (fd) 138
Chapter 6 Challenges 144
Chapter 7: Pipes and Filters
145
Linking Commands 145
Multiple commands 146
Putting jobs in background 147
Pipes 149
How to use pipes to connect programs 150
Input redirection in pipes 152
Output redirection in pipes 153
Why use pipes 153
Filters 154
Chapter 7 Challenges 156
Chapter 8: Traps
157
Signals 157
What is a Process? 158
How to view Processes 160
Sending signal to Processes 163
Terminating Processes 165
Shell signal values 168
The trap statement 169
How to clear trap 171
Include trap statements in a script 173
Use the trap statement to catch signals and handle errors 175
What is a Subshell? 179
Compound command 181
Exec command 182
Chapter 8 Challenges 183
Chapter 9: Functions
184
Writing your first shell function 184
Displaying functions 185
Removing functions 187
Defining functions 187
Writing functions 189
Calling functions 191
Pass arguments into a function 195
Local variable 198
Returning from a function 201
Shell functions library 203
Source command 206
Recursive function 207
Putting functions in background 209
Chapter 9 Challenges 211
剩余244页未读,继续阅读
资源评论
starskyylh
- 粉丝: 1
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功