linux shell script check if string is empty

Tài liệu Cơ bản về Linux Shell Script pdf

Tài liệu Cơ bản về Linux Shell Script pdf

Ngày tải lên : 15/12/2013, 20:15
... Lập trình Shell cung cấp tập hợp lệnh đặc biệt mà từ tạo nên chơng trình, đợc gọi shell script Trong thực tế hầu hết lệnh sử dụng sổ lệnh Unix ngợc lại, lệnh Unix viết shell script Shell script ... dẫn sử dụng, nhng thực tế Linux hệ điều hành kế thừa Unix Linuxshell tơng tự bạn sử dụng giới thiệu shell với hệ thống Linux Những loại shell thời Hiện có nhiều loại shell đợc sử dụng hệ thống ... (job control) Korn shell C shell Bạn thay đổi shell mặc định sang loại khác cách sử dụng lệnh: Ví dụ chuyển từ Bourne shell sang C shell: exec csh đổi shell lệnh: chsh [ ] Cấu trúc lệnh...
  • 15
  • 1.2K
  • 24
Tài liệu Cơ bản về Linux Shell Script ppt

Tài liệu Cơ bản về Linux Shell Script ppt

Ngày tải lên : 16/12/2013, 13:15
... Lập trình Shell cung cấp tập hợp lệnh đặc biệt mà từ tạo nên chơng trình, đợc gọi shell script Trong thực tế hầu hết lệnh sử dụng sổ lệnh Unix ngợc lại, lệnh Unix viết shell script Shell script ... dẫn sử dụng, nhng thực tế Linux hệ điều hành kế thừa Unix Linuxshell tơng tự bạn sử dụng giới thiệu shell với hệ thống Linux Những loại shell thời Hiện có nhiều loại shell đợc sử dụng hệ thống ... (job control) Korn shell C shell Bạn thay đổi shell mặc định sang loại khác cách sử dụng lệnh: Ví dụ chuyển từ Bourne shell sang C shell: exec csh đổi shell lệnh: chsh [ ] Cấu trúc lệnh...
  • 15
  • 721
  • 3
The Linux Shell and BASH Scripting

The Linux Shell and BASH Scripting

Ngày tải lên : 24/06/2013, 01:25
... # VAR1=“This is a String1 ” # VAR2=“$VAR1xyz” # VAR3=“${VAR1}xyz” # VAR4=‘${VAR1}xyz’ # echo $VAR1; echo $VAR2; echo $VAR3 # echo $VAR4 This is a String1 Nothing # default This is a String1 xyz ... of Script The Saigon CTT  $ more example _script #!/bin/bash /usr/bin/nmbd -D /usr/bin/smbd -D The Saigon CTT  The Linux Shell  Shells : Bourne (sh), Bourne Again (bash), Korn (ksh), C shell ...  Objectives  Identify differrent Linux shell environments  Understand the redirection of input  Understand and utilize command substitution  Write and configure BASH script using variables,...
  • 32
  • 396
  • 0
Shell Script Debugging

Shell Script Debugging

Ngày tải lên : 05/10/2013, 08:51
... debug-level logic you wish In the example here, I am checking if the debug variable is greater than some specified value If it is, the debug output is displayed With this model, if you have various ... their output displayed This is fine if your program is working to perfection and will not need further modification However, if you’re constantly making changes to a script that is actually being ... CHAPTER ■■■ Shell Script Debugging E ven though this book isn’t a “how to script manual, some concepts that are fundamental to writing successful scripts should be discussed Debugging is one of...
  • 11
  • 281
  • 1
Linux Shell

Linux Shell

Ngày tải lên : 19/10/2013, 22:15
... Trang 20 Linux Shell đặt Shell có giá trị Shell Giá trị không xuất đặt lại bạn thoát Shell Giả sử bạn viết Shell script tên whatday sau : echo " Today is $today " today=Friday echo " Today is $today ... gọi lại lệnh trước 15 Làm việc với kịch Shell (Shell Script) : Shell script tập hợp nhiều lệnh shell file Để thi hành lệnh , bạn đánh vào tên file Shell scipt đem lại thận lợi sau: - bạn đánh ... trình hoàn tất , hình bạn xuất dòng chữ sau : System is down Trang Linux Shell Chương II : Tìm hiểu & sử dụng Linux shell I- Các lệnh Linux Shell : Phép kết gán : Phép kết gán cho phép ánh xạ...
  • 35
  • 673
  • 1
Sử dụng Linux Shell

Sử dụng Linux Shell

Ngày tải lên : 24/10/2013, 22:15
... Trang 20 Linux Shell đặt Shell có giá trị Shell Giá trị không xuất đặt lại bạn thoát Shell Giả sử bạn viết Shell script tên whatday sau : echo " Today is $today " today=Friday echo " Today is $today ... gọi lại lệnh trước 15 Làm việc với kịch Shell (Shell Script) : Shell script tập hợp nhiều lệnh shell file Để thi hành lệnh , bạn đánh vào tên file Shell scipt đem lại thận lợi sau: - bạn đánh ... trình hoàn tất , hình bạn xuất dòng chữ sau : System is down Trang Linux Shell Chương II : Tìm hiểu & sử dụng Linux shell I- Các lệnh Linux Shell : Phép kết gán : Phép kết gán cho phép ánh xạ...
  • 35
  • 371
  • 0
Linux Shell Basic

Linux Shell Basic

Ngày tải lên : 09/11/2013, 02:15
... bảo shell thực thi text file thay nhập vào lệnh Điều gọi shell script Định nghĩa: Shell script chuỗi lệnh viết plain text file Shell script giống batch file MS-DOS mạnh Tại phải viết shell script: ... nhận prompt khác nhau) Để xem shell hành, gõ lệnh sau: $ echo $SHELL Làm để sử dụng Shell: đơn giản gõ lệnh Shell script gì: Bình thường shell trình giao tiếp Có nghĩa shell chấp nhận lệnh từ bạn ... Bất kỳ shell đọc lệnh từ người dùng (bàn phím chuột) bảo cho Linux Os mà người dùng muốn Nếu cho lệnh từ bàn phím gọi giao diện dòng lệnh (thường có $ prompt trước, prompt phù thuộc vào shell...
  • 2
  • 333
  • 0
Tài liệu Linux Shell Basic pptx

Tài liệu Linux Shell Basic pptx

Ngày tải lên : 22/12/2013, 13:17
... bảo shell thực thi text file thay nhập vào lệnh Điều gọi shell script Định nghĩa: Shell script chuỗi lệnh viết plain text file Shell script giống batch file MS-DOS mạnh Tại phải viết shell script: ... nhận prompt khác nhau) Để xem shell hành, gõ lệnh sau: $ echo $SHELL Làm để sử dụng Shell: đơn giản gõ lệnh Shell script gì: Bình thường shell trình giao tiếp Có nghĩa shell chấp nhận lệnh từ bạn ... Bất kỳ shell đọc lệnh từ người dùng (bàn phím chuột) bảo cho Linux Os mà người dùng muốn Nếu cho lệnh từ bàn phím gọi giao diện dòng lệnh (thường có $ prompt trước, prompt phù thuộc vào shell...
  • 2
  • 422
  • 0
Tài liệu Bài 4: Shell script, hệ thống log, quản lý tiến trình, dịch vụ cron_Âu Bửu Long ppt

Tài liệu Bài 4: Shell script, hệ thống log, quản lý tiến trình, dịch vụ cron_Âu Bửu Long ppt

Ngày tải lên : 24/12/2013, 10:19
... Mảng shell script • Mảng: • Tập hợp giá trị liệu lưu trủ qua tên • chung • Giống biến: không cần khai báo ... -l {} \; € BT  Viết đoạn script tìm file theo đuôi copy chúng sang thư mục cho trước Nếu trùng lại file copy file Nếu thư mục đích chưa tạo tự tạo Các lệnh mạng  ifconfig  nslookup  traceroute ... máy tại) IP nằm dòng, Mỗi lần chạy script kiểm tra đường gateway có internet? Nếu không internet tự động đổi cấu hình theo đường gateway IP cho Hệ thống log linux  Ghi lại nhật ký kiện hệ thống:...
  • 18
  • 629
  • 3
Tài liệu Hướng dẫn sử dụng Linux Shell pptx

Tài liệu Hướng dẫn sử dụng Linux Shell pptx

Ngày tải lên : 22/01/2014, 19:20
... Trang 20 Linux Shell đặt Shell có giá trị Shell Giá trị không xuất đặt lại bạn thoát Shell Giả sử bạn viết Shell script tên whatday sau : echo " Today is $today " today=Friday echo " Today is $today ... gọi lại lệnh trước 15 Làm việc với kịch Shell (Shell Script) : Shell script tập hợp nhiều lệnh shell file Để thi hành lệnh , bạn đánh vào tên file Shell scipt đem lại thận lợi sau: - bạn đánh ... trình hoàn tất , hình bạn xuất dòng chữ sau : System is down Trang Linux Shell Chương II : Tìm hiểu & sử dụng Linux shell I- Các lệnh Linux Shell : Phép kết gán : Phép kết gán cho phép ánh xạ...
  • 35
  • 522
  • 1
Tài liệu Linux Shell Scripting Tutorial Ver.1.0 docx

Tài liệu Linux Shell Scripting Tutorial Ver.1.0 docx

Ngày tải lên : 24/01/2014, 02:20
... Meaning string1 is equal to string2 string1 is NOT equal to string2 string1 -n string1 string1 is NOT NULL or not defined string1 is NOT NULL and does exist -z string1 string1 is NULL and does exist ... http://www.freeos.com/guides/lsst/shellprog.htm (11 of 19) [17/08/2001 17.42.21] Linux Shell Script Tutorial NOTE: == is equal, != is not equal For string Comparisons use Operator string1 = string2 string1 != string2 ... http://www.freeos.com/guides/lsst/shellprog.htm (8 of 19) [17/08/2001 17.42.21] Linux Shell Script Tutorial $ echo $? (6 )if- then-fi for decision making is shell script Before making any decision in Shell script you...
  • 47
  • 565
  • 1
Tài liệu Tìm hiểu và sử dụng Linux shell pdf

Tài liệu Tìm hiểu và sử dụng Linux shell pdf

Ngày tải lên : 25/01/2014, 16:20
... System is down Trần Vũ, Hoàng Trọng Xuân, Lớp 05T1 Trang : Tìm hiểu sử dụng Linux shell Chương II Tìm hiểu sử dụng Linux shell I Shell loại Shell Bourne Shell Bourne Shell biết với tên sh loại Shell ... pháp: Substring=$ {string: start_position:length} Vị trí xâu Nhược điểm cú pháp áp dụng xâu lấy có độ dài cố định không áp dụng cho Zshell Vd: string= ”this is a substring test” substring=$ {string: 10:9} ... sử dụng Linux shell Cũng giống Shell khác,trong Bourne Shell Script tệp chứa chuỗi lệnh thực theo thứ tự xếp tệp Bạn sử dụng trình sọan thảo để soạn tệp Script Ví dụ : Soạn thảo tệp Script có...
  • 41
  • 682
  • 1
Tài liệu Pro Bash Programming: Scripting the GNU/Linux Shell doc

Tài liệu Pro Bash Programming: Scripting the GNU/Linux Shell doc

Ngày tải lên : 17/02/2014, 17:20
... file is created if it doesn’t exist If it does exist, the file is truncated to zero length before anything is sent to it You can create an empty file by redirecting an empty string (that is, nothing) ... The shell is a programming language Don’t let anyone tell you otherwise The shell is not just glue that sticks bits together The shell is a lot more than a tool that runs other tools The shell is ... books about shell scripting His first book, Shell Scripting Recipes: A Problem-Solution Approach, was published by Apress in 2005 Introduced to Unix in 1990, Chris learned shell scripting because...
  • 257
  • 298
  • 3
Tài liệu Linux Shell Scripting Cookbook pdf

Tài liệu Linux Shell Scripting Cookbook pdf

Ngày tải lên : 21/02/2014, 19:20
... full path of script. sh If a script is run as a command-line argument for sh, the shebang in the script is of no use In order to self execute a shell script, it requires executable permission While ... file is executed using the shell utility www.it-ebooks.info Shell Something Out In this book we are dealing with Bash (Bourne Again Shell) , which is the default shell environment for most GNU /Linux ... length is the number of characters in the string Identifying the current shell Display the currently used shell as follows: echo $SHELL Or, you can also use: echo $0 15 www.it-ebooks.info Shell...
  • 360
  • 1.2K
  • 0
If he is ill, his parents will look after him pot

If he is ill, his parents will look after him pot

Ngày tải lên : 02/04/2014, 21:21
... tiết từ đó) If he is ill his parents will look after him 2 Các bạn di chuột vào cụm từ để biết chức cụm câu: If he is ill his parents will look after him 3 Tại câu lại dịch vậy? - If – nếu, ... *If he is ill, his parents will look after him Hình thức ngữ pháp: cấu trúc câu If + Simple Present , Future (will)” – Câu điều kiện loại ... đề IF , đó, không sử dụng dấu phẩy, có dạng “S + will + V + IF + S + Vs/es” Ví dụ: I will send her an invitation if I find her address (Tôi gửi thiếp mời tìm thấy địa cô ấy) - Cấu trúc If ...
  • 6
  • 416
  • 0
linux shell scripting with bash 2004

linux shell scripting with bash 2004

Ngày tải lên : 24/04/2014, 09:16
... Linux Shell Scripting with Bash TEAM LinG Linux Shell Scripting with Bash Ken O Burtch DEVELOPER’S LIBRARY Sams Publishing, 800 East 96th Street, Indianapolis, Indiana 46240 Linux Shell Scripting ... standard for shells Bash is the standard shell provided with most Linux distributions, including Red Hat, SuSE, Mandrake, Slackware, and UnitedLinux When Is a Program a Shell Script? A script is similar ... command chain is difficult to read and you should avoid it in scripts Command History Command History Bash keeps a list of the most recently typed commands.This list is the command history The...
  • 433
  • 1.3K
  • 0
hệ điều hành linux (shell)

hệ điều hành linux (shell)

Ngày tải lên : 04/05/2014, 21:43
... với hệ thống LINUX gọi SHELL Có nhiều trình thông dịch SHELL SHELL of BOURNE (sh) AT&T Korn SHELL (ksh) UNIX C SHELL (csh) Berkeley Tenex SHELL (tcsh) Bourne Again SHELL (bash) SHELL SHELL đóng ... string true chiều dài string > string1 = string2 true string1 giống string2 string1 != string2 true string1 khác string2 string1 < string2 String1 > string2 true arg1 OP arg2 so sánh hai số arg1 arg2, ... trình SHELL 27 Các phép kiểm tra khác (tt) file1 –nt file2 file1 –ot file2 file1 file2 file1 cũ file2 -z string true chiều dài string = -n string string true chiều dài string > string1 = string2 ...
  • 34
  • 563
  • 0
Shell script, quản lý người dùng, log, quản lý tiến trình, dịch vụ cron

Shell script, quản lý người dùng, log, quản lý tiến trình, dịch vụ cron

Ngày tải lên : 30/05/2014, 13:52
... Mảng shell script • Tập hợp giá trị liệu lưu trữ qua tên chung • Giống biến: không cần khai báo trước sử ... userdel • groupdel • Passwd • chpasswd Các lệnh mạng • ifconfig • nslookup • traceroute • ping • route Bài tập - Các lệnh mạng: • Viết script thực yêu cầu sau: • Thông báo tất trạng thái liên ... máy tại) IP nằm dòng, Mỗi lần chạy script kiểm tra đường gateway có internet? Nếu không internet tự động đổi cấu hình theo đường gateway IP cho Hệ thống log linux • Ghi lại nhật ký kiện hệ thống:...
  • 20
  • 420
  • 0
If life is so short doc

If life is so short doc

Ngày tải lên : 23/06/2014, 00:20
  • 1
  • 176
  • 0

Xem thêm