tailieunhanh - Unix Shell Programming Third Edition phần 2

Nó bắt đầu với một hướng dẫn tổng quát của Unix và các công cụ và sau đó di chuyển vào phạm vi bảo hiểm chi tiết về lập trình shell. Các chủ đề bao gồm: biểu thức thông thường, hạt nhân và các tiện ích, các tập lệnh, các thông số, thao tác văn bản | sue 15 47 users sue pat 99 7 users pat usr bin ksh bob 13 100 users data users data bin data_entry After login checks the password you typed in against the one stored in etc shadow it then checks for the name of a program to execute. In most cases this will be usr bin sh usr bin ksh or bin bash. In other cases it may be a special custom-designed program. The main point here is that you can set up a login account to automatically run any program whatsoever whenever someone logs in to it. The shell just happens to be the program most often selected. So login initiates execution of the standard shell on sue s terminal after validating her password see Figure . Figure . login executes usr bin sh. According to the other entries from etc passwd shown previously pat gets the program ksh stored in usr bin this is the Korn shell and bob gets the program data_entry see Figure . Figure . Three users logged in. The init program starts up other programs similar to getty for networked connections. For example sshd teinetd and riogind are started to service logins via ssh telnet and riogin respectively. Instead of being tied directly to a specific physical terminal or modem line these programs connect users shells to pseudo ttys. These are devices that emulate terminals over network connections. You can see this whether you re logged in to your system over a network or on an X Windows screen who phw pts 0 Jul 20 17 37 Logged in with rlogin Team LiB 1 PREVIOUS H NEXT Team LiB PREVIOUS Typing Commands to the Shell When the shell starts up it displays a command prompt typically a dollar sign at your terminal and then waits for you to type in a command see Figure Steps 1 and 2 . Each time you type in a command and press the Enter key Step 3 the shell analyzes the line you typed and then proceeds to carry out your request Step 4 . If you ask it to execute a particular program the shell searches the disk until it finds the named program. When found the shell asks the