Difference between revisions of "Tutorial 12 - Shell Scripting - Part 2"

From CDOT Wiki
Jump to: navigation, search
Line 1: Line 1:
 
Content under development
 
Content under development
 +
=ADDITIONAL SHELL SCRIPTING=
 +
===Main Objectives of this Practice Tutorial===
 +
 +
:* Use the '''if-elif-else''' control flow statement in a shell script.
 +
 +
:* Use the '''for''' loop control using a list with '''command substitution'''.
 +
 +
:* Use the '''while''' loop in a shell script.
 +
 +
:* Use the '''exit''' and '''break''' statements in a shell script.
 +
 +
:* Explain how to configure and use a '''.bashrc''' start-up file.
 +
<br>
 +
 +
===Tutorial Reference Material===
 +
 +
{|width="100%" cellspacing="0" cellpadding="10"
 +
 +
|- valign="top"
 +
 +
|colspan="2" style="font-size:16px;font-weight:bold;border-bottom: thin solid black;border-spacing:0px;"|Course Notes<br>
 +
 +
|colspan="2" style="font-size:16px;font-weight:bold;border-bottom: thin solid black;border-spacing:0px;padding-left:15px;"|Linux Command/Shortcut Reference<br>
 +
 +
|colspan="1" style="font-size:16px;font-weight:bold;border-bottom: thin solid black;border-spacing:0px;padding-left:15px;"|YouTube Videos<br>
 +
 +
|- valign="top" style="padding-left:15px;"
 +
 +
|colspan="2" |Course Notes:<ul><li>[https://matrix.senecacollege.ca/~osl640/slides/OSL640-Week12.pdf PDF] | [https://matrix.senecacollege.ca/~osl640/slides/OSL640-Week12.pptx PPTX]</li></ul>
 +
 +
 +
|  style="padding-left:15px;" |Control Flow Statements
 +
* [https://www.tutorialspoint.com/unix/if-else-statement.htm if-elif-else]
 +
* [https://www.cyberciti.biz/faq/bash-for-loop/#:~:text=A%20'for%20loop'%20is%20a,files%20using%20a%20for%20loop. for Loop]
 +
* [https://bash.cyberciti.biz/guide/While_loop while Loop]<br>
 +
Additional Statements
 +
* [https://www.geeksforgeeks.org/exit-command-in-linux-with-examples/#:~:text=exit%20command%20in%20linux%20is,last%20command%20that%20is%20executed.&text=After%20pressing%20enter%2C%20the%20terminal%20will%20simply%20close. exit]
 +
* [https://www.geeksforgeeks.org/break-command-in-linux-with-examples/#:~:text=break%20command%20is%20used%20to,The%20default%20number%20is%201. break]
 +
 +
|  style="padding-left:15px;"|Startup Files
 +
* [https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html Purpose]
 +
* [http://www.linuxfromscratch.org/blfs/view/svn/postlfs/profile.html Examples]
 +
 +
 +
|colspan="1" style="padding-left:15px;" width="30%"|Brauer Instructional Videos:<ul><li>[https://www.youtube.com/watch?v=XVTwbINXnk4&list=PLU1b1f-2Oe90TuYfifnWulINjMv_Wr16N&index=6 Bash Shell Scripting - Part 2]</li></ul>
 +
|}
  
 
= INVESTIGATION 1: ADDITIONAL LOGIC STATEMENTS =
 
= INVESTIGATION 1: ADDITIONAL LOGIC STATEMENTS =

Revision as of 14:04, 14 November 2021

Content under development

ADDITIONAL SHELL SCRIPTING

Main Objectives of this Practice Tutorial

  • Use the if-elif-else control flow statement in a shell script.
  • Use the for loop control using a list with command substitution.
  • Use the while loop in a shell script.
  • Use the exit and break statements in a shell script.
  • Explain how to configure and use a .bashrc start-up file.


Tutorial Reference Material

Course Notes
Linux Command/Shortcut Reference
YouTube Videos
Course Notes:


Control Flow Statements

Additional Statements

Startup Files


Brauer Instructional Videos:

INVESTIGATION 1: ADDITIONAL LOGIC STATEMENTS

INVESTIGATION 2: ADDITIONAL LOOPING STATEMENTS

INVESTIGATION 3: USING STARTUP FILES

LINUX PRACTICE QUESTIONS