linux bash script if else

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ệnh> done 6.4 Cấu trúc rẽ nhánh: if - else Cấu trúc rẽ nhánh đợc hiểu qua từ khóa có cấu trúc nh sau: if [ ] then [ elif then ] [ else ] fi Đối với cấu trúc ... 7: Cấu trúc if đơn giản #!/bin/sh #Vi du 7a echo Nhap so a: read a echo Nhap so b: read b if [ $a lt $b ] then echo so a nho hon so b. elif [ $a eq $b ] then echo so a bang so b. else echo so ... 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 tiện lợi việc gộp nhiều lệnh độc lập vào...
  • 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ệnh> done 6.4 Cấu trúc rẽ nhánh: if - else Cấu trúc rẽ nhánh đợc hiểu qua từ khóa có cấu trúc nh sau: if [ ] then [ elif then ] [ else ] fi Đối với cấu trúc ... 7: Cấu trúc if đơn giản #!/bin/sh #Vi du 7a echo Nhap so a: read a echo Nhap so b: read b if [ $a lt $b ] then echo so a nho hon so b. elif [ $a eq $b ] then echo so a bang so b. else echo so ... 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 tiện lợi việc gộp nhiều lệnh độc lập vào...
  • 15
  • 721
  • 3
Chương 7: Hệ điều hành Linux - Bash shell

Chương 7: Hệ điều hành Linux - Bash shell

Ngày tải lên : 09/05/2014, 11:11
... && /myfile Linux Fundamentals HCMUNS 19 Phát biểu điều kiện  Phát biểu IF if [ exp ]; then statements; elif [ expr ]; then statements; else statements; fi Linux Fundamentals  Ví dụ if [ “$1” ... cat ~/ .bash_ profile # Get the aliases and functions if [ -f ~/.bashrc ]; then ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:/usr/local/bin:$HOME/bin: export PATH Linux ... Có thể gọi shell script khác Tham số truyền dòng lệnh Linux Fundamentals HCMUNS 12 Chương trình “Hello” $ cat > hello.sh #!/bin /bash # This is a comment: simple hello shell script echo "Enter...
  • 32
  • 432
  • 0
cac lenh trong linux bash ppt

cac lenh trong linux bash ppt

Ngày tải lên : 22/06/2014, 01:20
... variables and functions Secure File Transfer Program Shift positional parameters Shell Options Shutdown or restart linux Delay for a specified time Sort text files Run commands from a file `.' ... tabs Uniquify files Convert units from one scale to another Remove variable or function names Unpack shell archive scripts Execute commands (until error) Create new user account Modify user account ... Remove files Remove folder(s) Remote file copy (Synchronize file trees) screen scp sdiff sed select seq set sftp shift shopt shutdown sleep sort source split ssh strace su sum symlink sync Terminal...
  • 4
  • 692
  • 1
Cấu trúc điều khiển If Else pot

Cấu trúc điều khiển If Else pot

Ngày tải lên : 08/08/2014, 15:20
... trúc điều khiển If ElseIf Else elseif kết hợp if else nói cách khác mở rộng if else để thực khối lệnh khác trường hợp điều kiện kiểm tra sai Sử dụng cấu trúc điều khiển if elseif else muốn lựa ... điều khiển if else lồng mặc định else với if gần (phía trên) Ví dụ: 2 thực Hỏi: else với if (if hay if 2)? Đáp: ... thực Ví dụ: 2 Các elseif viết lồng Có thể viết thành từ else if hay thành từ elseif Nhưng sử dụng...
  • 11
  • 435
  • 0
The Linux Shell and BASH Scripting

The Linux Shell and BASH Scripting

Ngày tải lên : 24/06/2013, 01:25
...  Objectives  Identify differrent Linux shell environments  Understand the redirection of input  Understand and utilize command substitution  Write and configure BASH script using variables, ... arrays Example 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), ... if- then -else : if [ ] # include SPACEs then # what to if the exp1 is true elseif [ ] then # what to if the exp2 is true else fi The Saigon CTT  Tests and Conditions  Case test:...
  • 32
  • 396
  • 0
Tài liệu Learning DebianGNU Linux-Chapter 13. Conquering the BASH Shell pptx

Tài liệu Learning DebianGNU Linux-Chapter 13. Conquering the BASH Shell pptx

Ngày tải lên : 14/12/2013, 13:15
... path later Linux includes several standard scripts that are run at various times Table 13.6 identifies these and gives the time when each is run You can modify these scripts to operate differently ... Executed when the user logs in ~/.bashrc Executed when BASH is launched ~/ .bash_ logout Executed when the user logs out If you want to modify one of the standard scripts that should reside in your ... consult the Linux man pages Table 13.1: Common Linux Shells Shell Program name name(s) ASH /bin/ash shell Description Resembles the shell used by AT&T's System V Unix /bin/bsh BASH /bin /bash shell...
  • 61
  • 356
  • 0
Tài liệu Writing a Script File in Linux pptx

Tài liệu Writing a Script File in Linux pptx

Ngày tải lên : 18/01/2014, 05:20
... type: wq To verify that the backup script exists, at the command prompt type: ls Does the file “backup” exist in this directory? Y/N To verify that the contents of the backup script, at ... be verified? - IT Essentials II v2.0 - Lab 10.4.10 Copyright  2002, Cisco Systems, Inc _ Step 3: Executing the Script At the command prompt, execute the script: ... Script At the command prompt, execute the script: /home/studentA5/backup To verify that a new file was created after the script was executed, type: ls Does a file called mybkup.tar now exist in the...
  • 4
  • 442
  • 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
... 205 BASH 205 BASHPID .205 BASH_ ALIASES 205 BASH_ ARGC 205 BASH_ ARGV 205 BASH_ CMDS 206 BASH_ COMMAND ... 206 BASH_ EXECUTION_STRING 206 BASH_ LINENO 206 BASH_ REMATCH 206 BASH_ SOURCE .206 BASH_ SUBSHELL 206 BASH_ VERSINFO 207 BASH_ VERSION ... ■ CONTENTS Pro Bash Programming Scripting the GNU /Linux Shell ■■■ Chris F.A Johnson i www.it-ebooks.info ■ CONENTS Pro Bash Programming: Scripting the GNU /Linux Shell Copyright © 2009...
  • 257
  • 298
  • 3
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 ... function while elif if time else in { Unlike most computer languages, Bash allows keywords to be used as variable names even though this can make scripts difficult to read.To keep scripts understandable, ... publishing about writing a series of Linux books Because Linux begins with Bash, Bash would be the topic of my first book So if you’ve been dying for a good Bash book, thank Michael Lawrence Law,...
  • 433
  • 1.3K
  • 0
Chương 3: Giới thiệu Bash shell Linux

Chương 3: Giới thiệu Bash shell Linux

Ngày tải lên : 08/05/2014, 13:19
... [else ] fi Linux also provides the if elif construct, the syntax of which is as follows: if condition(s) then command(s) elif condition then command(s) else command(s) ... shift Command • The following shell script uses the shift command in parameter handling: if test $# -eq then echo "Arguments required" exit fi command=$1 shift if test $command = 'c' then if ... character The if Construct • • • Linux provides the if Construct to perform decision making in shell scripts The if construct is usually used in conjunction with the test command if ...
  • 34
  • 512
  • 0
Mệnh đề if then và else trong VBA excel

Mệnh đề if then và else trong VBA excel

Ngày tải lên : 27/08/2015, 00:10
... Else Statement Tạo command button worksheet bạn, paste đoạn code bên dưới: Dim score As Integer, result As String score = Range("A1").Value If score >= 60 Then result = "pass" Else result ... End If Range("B1").Value = result Kết click vào command button: Giải thích: Nếu score lớn 60, Excel VBA trả giá trị pass, không trả giá trị fail Chú ý: Nếu sau Then, bạn có dòng code mệnh đề Else, ... bạn không cần dùng End (như ví dụ đầu viết) Các trường hợp khác, sau Then Else bạn cần xuống dòng kết thúc mệnh đề End If ...
  • 2
  • 706
  • 6
EMBEDDED LINUX SYSTEM DESIGN AND DEVELOPMENT.pdf

EMBEDDED LINUX SYSTEM DESIGN AND DEVELOPMENT.pdf

Ngày tải lên : 04/08/2012, 14:23
... system is shifting towards embedded Linux From lower cost to rich toolset, these benefits are providing a big thrust for using Linux in embedded areas 1.3 Embedded Linux Versus Desktop Linux Linux is ... Computing demonstrated a Linux- based PDA at Linuxworld This year also saw increased awareness about real-time support in Linux Ⅲ TimeSys® Corporation announced Linux/ RT™, an embedded Linux distribution ... using Linux in embedded areas Ⅲ Rick Lehrbaum started an embedded Linux portal: Linuxdevices.com Ⅲ RTAI was released by Paolo Mantegazza to add hard real-time support in Linux Ⅲ BlueCat® Linux...
  • 429
  • 1.7K
  • 2
Lập trình Java Script

Lập trình Java Script

Ngày tải lên : 16/08/2012, 15:07
... mytime; if( myday == 0) day = " Chủ nhật , "; else if( myday == ) day = "Thứ hai, "; else if( myday == ) day = "Thứ ba, "; else if( myday == ) day = "Thứ tư, "; else if( myday == 4) day = "Thứ năm, "; else ... ba "; else if( mymonth ==3 ) month = "tháng tư "; else if( mymonth ==4 ) month = "tháng năm "; else if( mymonth ==5) month = "tháng sáu "; else if( mymonth ==6 ) month = "tháng bảy "; else if( mymonth ... năm, "; else if( myday == ) day = "Thứ sáu, "; else if( myday == ) day = "Thứ bảy, "; if( mymonth == ) { month = "tháng ";} 40 JavaScript else if( mymonth ==1 ) month = "tháng hai "; else if( mymonth...
  • 209
  • 2.7K
  • 25
Linux cho người mới dùng

Linux cho người mới dùng

Ngày tải lên : 16/08/2012, 15:51
... list3) d˙ a ˙ ˙ ˜ ˙ ˙ ˙ ’’ toán tu if ´’ ˘ ¯u ˆ ˆ ’ ˆ ’ ˆ ’ ˙ ˙ ˙ ˙ ` ˆ ¯’ ’ ˆ Dang day du cua˙ lenh if nhu sau: ˙ ¯ ’ ˙ if list then list [ elif list then list ] [ else list ] fi ˙ ´ ` ’’ ¯ây ´ ... ’ ¯ã ’ ˙ ˜ tro các˙ toán tu lua chon if then else case, cung ` ’’ ’ d ˆ u kien He vo bash ho ’ ˜ ¯ie ˆ ˆ ’ ˆ ˙ toán˙ tu vòng lap for, while, ˙until, nho d (bash) tro thành mot ngôn ˙ ˙ ’’ ’’ nhu ... ra), nhu the bash có ˆ’ ’ ¯u ’ ¯e ˆ ˆ ’ ’ ˙, xin ngam hieu d bash ’ ¯ó ´ ’’ ’´’ ` se chı xem xét bash, the o duoi nói d´ n he vo ˜ ’ ¯e ˆ ’ ˆ ˆ ˆ ˆ ˙ Nhung ho tro viec thuc ˜ Tu mot bash không...
  • 55
  • 773
  • 4
Quản trị hệ điều hành linux

Quản trị hệ điều hành linux

Ngày tải lên : 17/08/2012, 08:54
... HÀNH LINUX M CL C Gi i thi u h i u hành Linux 1.1 L ch s Linux 1.2 Cài t Linux Giao ti p môi trư ng Linux 2.1 Gi i thi u trình so n th o vi 2.2 Gi i thi u ti n ích mc 2.3 Các câu l nh b n Linux ... www.nhipsongcongnghe.net Gi i thi u h 1.1 i u hành Linux L ch s Linux h i u hành mô ph ng Unix, c xây d ng ph n nhân (kernel) gói ph n m m mã ngu n m Linux c công b dư i b n quy n c a GPL (General ... tri n c a linux sau: - Năm 1991: 100 ngư i dùng - Năm 1997: 7.000.000 ngư i dùng - Năm 2000: hàng trăm tri u ngư i dùng, 15.000 ngưòi tham gia phát tri n Linux Hàng năm th trư ng cho Linux tăng...
  • 113
  • 2.7K
  • 15
Tự học sử dụng Linux

Tự học sử dụng Linux

Ngày tải lên : 17/08/2012, 09:18
... Microsoft nhìn thấy Linux khả cạnh tranh lớn nhiều coi Linux kẻ thù Nhiều tổ chức phủ phi phủ nhìn thấy Linux hệ điều hành nhiều hứa hẹn hỗ trợ cho Linux Những nước nghèo tìm thấy Linux cách giải ... chương sách “Tự học sử dụng Linux trả lời ngắn gọn cho câu hỏi Linux gì?” Đồng thời nói đôi dòng điểm đặc biệt Linux, yêu cầu Linux phần cứng, khái niệm phân phối Linux, cách có phân phối Hơn ... thích hợp bạn thích sách “Tự học sử dụng Linux in để tiện đọc Tôi bắt đầu học Linux có tay đĩa CD RedHat 7.0 khoảng năm trước Và Linux (cụ thể OpenSUSE Linux) hệ thống làm việc máy tính Không...
  • 212
  • 960
  • 8
Bài tập java Script

Bài tập java Script

Ngày tải lên : 17/08/2012, 10:40
... thị thông báo "Welcome to JavaScript !" Hướng dẫn: Dùng thẻ để tạo nút nhấn thêm thuộc tính onClick = ";" (Trong lệnh JavaScript bất kỳ, ví dụ lệnh document.write, ... lệnh JavaScript" 11 "Các câu lệnh JavaScript" câu lệnh JavaScript chúng phải cách dấu chấm phảy Ngoài ra, câu lệnh phải đặt cặp dấu nháy kép (Hoặc nháy đơn) Ví dụ số cách đưa câu lệnh JavaScript ... Giáo trình lý thuyết HTML, DHTML & JavaScript Aptech worldwide - Các trang web nên ghé thăm www.3schools.com Search với từ khóa Java Script tutorial; Java script Introduction  MỤC LỤC Chương 0:...
  • 47
  • 3.9K
  • 24
Bài tập thực hành Java Script

Bài tập thực hành Java Script

Ngày tải lên : 17/08/2012, 10:48
... hành Javascript _Nguyễn Hữu Tuấn if (alt==0) alt=1 else alt=0 if (alt==0) curpos1=temp else curpos2=temp if (curpos1!=curpos2){ if (document.all) currentpos=document.body.scrollTop+1 else currentpos=window.pageYOffset+1 ... window.status = out if (jumpSpaces 3) { jumpSpaces *= 75} else { jumpSpaces } if (position ... Javascript _Nguyễn Hữu Tuấn
  • 18
  • 2.2K
  • 21
Tài liệu về Linux

Tài liệu về Linux

Ngày tải lên : 18/08/2012, 11:19
... Open Linux củ a Casldera cũ n g că c trê n bả n phá t hà n h Red Hat Bả n phá t hà n h HOWTO cũ n g cung cấ p mộ t danh sá c h chi tiế t củ a cá c bả n Linux BÀ I L I ÍCH CỦ A LINUX Sử dụ n g Linux ... đầ y đủ BÀ I KHÍA CẠ NH THƯONG MẠ I CỦ A LINUX Nhiề u doanh nghiệ p dù n g Linux chạ y Wed server cho mạ n g Intranet củ a họ tính kinh tế củ a Linux, Linux cũ n g đượ c dù n g cho nhiề u ứ ng ... vớ i Linux cho phé p chạ y đa nhiệ m thự c Vớ i Linux, bạ n cù n g lú c thự c hiệ n mộ t số chương trình sau: chuyể n tậ p tin, in hồ sơ, ché p đóa mề m,sử dụ n g CD-ROM, chơi trò chơi Linux...
  • 22
  • 917
  • 10

Xem thêm