Open main menu

CDOT Wiki β

Changes

no edit summary
{|cellpadding="15" width="100%"
|-
|'''Script #1: Generate a Simple Report:<br>''' [ [https://scs.senecac.on.ca/~murray.saul/text-report.bash text-report.bash] ]<br>'''Sample output:''' [ [https://scs.senecac.on.ca/~murray.saul/report.txt /root/report.txt] ]<br><br>'''Scripting Skills:'''<blockquote><ul><li>'''if''' statement</li><li>'''exit''' command</li><li>USER '''Environment Variable'''</li><li>'''redirection''' (both &gt; and &gt;&gt;)</li><li>'''command substitution'''</li></ul></blockquote>'''Practical Consideration for scripting in lab1:'''<br><blockquote> Students create simple bash shell script, add elements, then have them copy and paste, then run this script. Key elements related to the script is evaluated and provides basis for other scripting tasks in other labs? Should midterm and/or final exam contain a scripting question? (recommended)<br><br>
|[[Image:lab1-script-text-report.png|thumb|left|400px|When executed as '''root''' or using '''sudo''' command, script generates a basic text-based report in a file]]
|}
{|cellpadding="15" width="100%"
|-
|'''Script #2 Generate Report Graphically:<br>''' [ [https://scs.senecac.on.ca/~murray.saul/report.bash report.bash] ]<br>'''Sample output:''' [ [https://scs.senecac.on.ca/~murray.saul/report.txt /root/report.txt] ]<br><br>'''Scripting Skills:'''<blockquote><ul><li>'''if''' statement</li><li>'''exit''' command</li><li>USER '''Environment Variable'''</li><li>'''redirection''' (both &gt; and &gt;&gt;)</li><li>'''zenity'''</li><li>'''for''' loop</li><li>'''command substitution'''</li><li>'''sed'''</li><li>'''set''' command ('''positional parameters''')</li></ul></blockquote><br><br>'''Practical Consideration for scripting in lab1:<br><blockquote>''' Students use '''wget''' to download existing shell script and run it to see what happens. Students are '''encouraged to view contents of more advanced shell script(s)''', to see where the commands are being used (from previous shell script), but are '''not required to understand more complex elements''' of these shell scripts.<br><br>
|[[Image:lab1-script-1.png|thumb|left|175px|When executed as '''root''' or using '''sudo''' command, provides VM status and opportunity to '''start''' VMs]]
|[[Image:lab1-script-2.png|thumb|left|175px|When executed as '''root''' or using '''sudo''' command, provides VM status and opportunity to stop '''running''' VMs]]
13,420
edits