找回密码
 注册
搜索
查看: 1002|回复: 3

linux-programming

[复制链接]
发表于 2005-12-7 22:39:00 | 显示全部楼层 |阅读模式
[upload=jpg]UploadFile/2005-12/05127@52RD_1.JPG[/upload]
Foreword by Alan Cox xxxi
Introduction xxxiii
Chapter 1: Getting Started 1
An Introduction to UNIX, Linux, and GNU 1
What Is UNIX? 1
A Brief History of UNIX 2
UNIX Philosophy 2
What Is Linux? 3
The GNU Project and the Free Software Foundation 3
Linux Distributions 4
Programming Linux 5
Linux Programs 5
The C Compiler 6
Try It Out—Our First Linux C Program 7
Development System Roadmap 8
Applications 8
Header Files 8
Library Files 9
Static Libraries 10
Try It Out—Static Libraries 10
Shared Libraries 12
Getting Help 13
Try It Out—Manual Pages and info 14
Summary 15
Chapter 2: Shell Programming 17
Why Program with a Shell? 18
A Bit of Philosophy 18
What Is a Shell? 19
Pipes and Redirection 21
Redirecting Output 21
Redirecting Input 22
Pipes
viii
The Shell as a Programming Language 23
Interactive Programs 23
Creating a Script 25
Making a Script Executable 26
Shell Syntax 27
Variables 28
Quoting 28
Try It Out—Variables 29
Environment Variables 29
Parameter Variables 30
Try It Out—Parameter and Environment Variables 31
Conditions 32
The test, or [, Command 32
Control Structures 35
if 35
Try It Out—Using the if Command 35
elif 36
Try It Out—Doing Further Checks with an elif 36
A Problem with Variables 36
for 37
Try It Out—for Loop with Fixed Strings 38
Try It Out—for Loop with Wildcard Expansion 38
while 39
Try It Out—Here We Go Again, Again 40
until 41
case 41
Try It Out—Case I: User Input 42
Try It Out—Case II: Putting Patterns Together 42
Try It Out—Case IIl: Executing Multiple Statements 43
Lists 44
Try It Out—AND Lists 45
Try It Out—OR Lists 46
Statement Blocks 47
Functions 47
Try It Out—A Simple Function 47
Try It Out—Returning a Value 49
Commands 50
break 50
The : Command 51
ix
Contents
continue 51
The . Command 52
Try It Out—The Dot Command 53
echo 53
eval 54
exec 54
exit n 55
export 55
Try It Out—Exporting Variables 56
expr 56
printf 57
return 58
set 58
shift 59
trap 60
Try It Out—Trapping Signals 60
unset 62
Two More Useful Commands and Regular Expressions 62
Try It Out—find with Tests 64
Try It Out—Basic grep Usage 66
Try It Out—Regular Expressions 68
Command Execution 69
Arithmetic Expansion 70
Parameter Expansion 70
Try It Out—Parameter Processing 72
Here Documents 73
Try It Out—Using Here Documents 73
Try It Out—Another Use for a Here Document 74
Debugging Scripts 75
Going Graphical—The Dialog Utility 76
Try It Out—Using the dialog Utility 78
Try It Out 79
Putting It All Together 80
Requirements 81
Design 81
Try It Out—A CD Application 83
Notes on the Application 90
Summary 90
x
Contents
Chapter 3: Working with Files 91
Linux File Structure 92
Directories 92
Files and Devices 93
/dev/console 93
/dev/tty 93
/dev/null 94
System Calls and Device Drivers 94
Library Functions 95
Low-Level File Access 96
write 96
read 97
open 98
Initial Permissions 100
umask 100
close 101
ioctl 102
Try It Out—A File Copy Program 102
Other System Calls for Managing Files 104
lseek 104
fstat, stat, and lstat 104
dup and dup2 106
The Standard I/O Library 107
fopen 108
fread 108
fwrite 109
fclose 109
fflush 109
fseek 110
fgetc, getc, and getchar 110
fputc, putc, and putchar 110
fgets and gets 111
Formatted Input and Output 111
printf, fprintf, and sprintf 112
scanf, fscanf, and sscanf 114
Other Stream Functions 116
Try It Out—Another File Copy Program 116
Stream Errors 117
Streams and File Descriptors 118
File and Directory Maintenance 118
chmod 118
chown 119
xi
Contents
unlink, link, and symlink 119
mkdir and rmdir 119
chdir and getcwd 120
Scanning Directories 120
opendir 121
readdir 121
telldir 122
seekdir 122
closedir 122
Try It Out—A Directory-Scanning Program 122
Errors 125
strerror 125
perror 126
The /proc File System 126
Advanced Topics: fcntl and mmap 130
fcntl 130
mmap 131
Try It Out—Using mmap 132
Summary 134
Chapter 4: The Linux Environment 135
Program Arguments 135
Try It Out—Program Arguments 137
getopt 138
Try It Out—getopt 139
getopt_long 140
Environment Variables 142
Try It Out—getenv and putenv 143
Use of Environment Variables 144
The environ Variable 145
Try It Out—environ 145
Time and Date 146
Try It Out—time 146
Try It Out—gmtime 148
Try It Out—ctime 150
Try It Out—strftime and strptime 152
Temporary Files 153
Try It Out—tmpnam and tmpfile 154
User Information 155
Try It Out—User Information 156
Host Information 158
Try It Out—Host Information 159
xii
Contents
Logging 160
Try It Out—syslog 162
Try It Out—logmask 163
Resources and Limits 164
Try It Out—Resource Limits 167
Summary 169
Chapter 5: Terminals 171
Reading from and Writing to the Terminal 171
Try It Out—Menu Routines in C 172
Canonical versus Non-Canonical Modes 173
Handling Redirected Output 174
Try It Out—Checking for Output Redirection 175
Talking to the Terminal 176
Try It Out—Using /dev/tty 176
The Terminal Driver and the General Terminal Interface 178
Overview 178
Hardware Model 179
The termios Structure 180
Input Modes 181
Output Modes 182
Control Modes 183
Local Modes 183
Special Control Characters 184
Characters 185
The TIME and MIN Values 185
Accessing Terminal Modes from the Shell 186
Setting Terminal Modes from the Command Prompt 187
Terminal Speed 187
Additional Functions 188
Try It Out—A Password Program with termios 189
Try It Out—Reading Each Character 190
Terminal Output 191
Terminal Type 191
Identify Your Terminal Type 192
Using terminfo Capabilities 195
Try It Out—Total Terminal Control 198
Detecting Keystrokes 200
Try It Out—Your Very Own kbhit 200
Virtual Consoles 202
Pseudo Terminals 204
Summary 204
xiii
Contents
Chapter 6: Managing Text-Based Screens with curses 205
Compiling with curses 206
Concepts 207
Try It Out—A Simple curses Program 208
Initialization and Termination 210
Output to the Screen 210
Reading from the Screen 211
Clearing the Screen 211
Moving the Cursor 212
Character Attributes 212
Try It Out—Moving, Inserting, and Attributes 212
The Keyboard 214
Keyboard Modes 215
Keyboard Input 215
Try It Out—Keyboard Modes and Input 216
Windows 217
The WINDOW Structure 217
Generalized Functions 218
Moving and Updating a Window 218
Try It Out—Multiple Windows 219
Optimizing Screen Refreshes 222
Subwindows 223
Try It Out—Subwindows 223
The Keypad 225
Try It Out—Using the Keypad 226
Color 227
Try It Out—-Colors 229
Redefining Colors 230

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| 发表于 2005-12-7 22:44:00 | 显示全部楼层

[/UseMoney]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
点评回复

使用道具 举报

发表于 2006-2-24 22:16:00 | 显示全部楼层
<P>This is good book for linux programmer</P>
点评回复

使用道具 举报

发表于 2014-1-16 06:01:51 | 显示全部楼层
都藏到二楼去了,哈哈!
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-11-23 01:19 , Processed in 0.060255 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表