Presentation is loading. Please wait.

Presentation is loading. Please wait.

EMT 2390L Lecture 9 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts.

Similar presentations


Presentation on theme: "EMT 2390L Lecture 9 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts."— Presentation transcript:

1 EMT 2390L Lecture 9 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts

2 Outline Branching with if Branching with case while loop for loop

3 Branching with if if statement allows you to evaluate a condition and branch based on the results Syntax Example

4 Test and Expressions An if command will test an expression You may use test or enclose it with [ ] o text expression o [ expression ] When using [ expression ] you must leave a space after opening the first bracket and another space before closing the last bracket [expression] may give unexpected results (notice the lack of spacing)

5 String Expressions

6 Integer Expressions

7 Branching with case Case syntax Case example

8 while Loop Syntax Example

9 for Loop C-language Syntax Example

10 More info Visit the book author’s website at: o http://linuxcommand.org/lc3_writing_shell_scripts.php http://linuxcommand.org/lc3_writing_shell_scripts.php More details about decision and repetition statements Examples

11 Assignments Check the class OpenLab site for new Labs Check Blackboard for new Quizzes Work on your Project Study for the Second Exam (next week)


Download ppt "EMT 2390L Lecture 9 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts."

Similar presentations


Ads by Google