Tải bản đầy đủ (.ppt) (106 trang)

Bài giảng lập trình shell

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (2.46 MB, 106 trang )

LẬP TRÌNH SHELL


Nội dung


Lập trình bằng shell


Đặc trưng của script


Cấu trúc shell-script


Create File & Run Script


Review commands


Parameter & Variables


Parameter




Entity that stores values


3 type


positional parameters





special parameters




arguments present on command line
referenced by number
set by shell to store info about aspects of current state

Variable



identified by a name.
Contain values


Positional Parameters


Giá trị default của tham số



Shift


Shift


Khác nhau giữa * và @


Biến tiền định nghĩa


Lệnh nội trú


Echo


Echo – ví dụ


Example for ouput’s format


Result


Read



Command Substitution


Exit Status


Cấu trúc If


If – ví dụ


If ví dụ


Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×