Open main menu

CDOT Wiki β

Changes

no edit summary
== Lab 1:==
[[Image:lab1-script-1.png||right||thumb|275px|When executed as '''root''' or using '''sudo''' command, prompts for elements to include in report]][[Image:lab1-script-2.png||right|thumb|275px|Notifies completion of report and file pathname of report]]::'''Scripting for Lab1'''. Lab 1 could be modified to have students generate a report regarding the collection of Linux information after an install. Certainly '''command substitution''' could be taught and to reinforce '''redirection''' >> to add content to a filename (i.e. not over-ride). It would be interesting to expose students to the '''zenity''' command to allow a menu to give user choice of report elements to include in the generated report. Perhaps a link to a "fancy" Bash shell script to generate a web-page so students can view the contents in a nice format. This scripting element could easily be added to assignment #1.<br><br>OPS435 ElementsIt is recommended to add to lab1 a simple '''step-by-step procedure to generate a simple text-based report in a shell script''' (eg. '''text-report.bash'''), but also have students use '''wget''' command to download, set execute permissions and run more sophisticated shell scripts (eg. '''report.bash''' and '''report2.bash''')  :'''Example of Simple text-based report (text-report.bash):''' {|cellpadding="15" width="100%"|-|</blockquote><br><br>Example of Shell script Demo: [ [[lab1 Shell Script Demo|report.bash]] ]<br><br>Listing of Scripting Skills from Demo Listed Above:<blockquote><ul><li>'''if''' statement</li><li>'''exit'''command substitution</li><li>USER '''Environment Variable''' (shell grammar?)</li><li>'''redirection''' (both &gt; vs and &gt;&gt;)</li><li>'''zenity'''</li><li>'''IO Stream vs Graphical Interactionfor''' (eg. zenity)loop</li><li>'''Scripting Samples (View and adaptcommand substitution'''</li><li>'''sed''- don't "re-invent the wheel completely")</li><li>Exposure to '''forset''' loop with command ('''positional parameters''' )</li></ul></blockquote><br><br>Connection with ULI101 Scripting Skills (Course Outline):<br>Connection with OPS435 Scripting Skills (storing checkbox selectionsCourse Outline) :<br><br>'''Practical Consideration for reportscripting in lab1:''' Do students create simple bash shell script, add elements, then have them copy and paste, then run this more complex script? Key elements of scripting elements should be contained in information boxes in lab. Should midterm and/or final exam contain a scripting question? (recommended)<br></ulbr>|[[Image:lab1-script-1.png|thumb|left|275px|When executed as '''root''' or using '''sudo''' command, provides VM status and opportunity to '''start''' VMs]]|[[Image:lab1-script-2.png|thumb|left|275px|When executed as '''root''' or using '''sudo''' command, provides VM status and opportunity to stop '''running''' VMs]]|} :'''Script demo of using Zenity command (report.bash):''' 
{|cellpadding="15" width="100%"
|-
|}
:Script demo of generating web-based report (report2.bash)
{|cellpadding="15" width="100%"
13,420
edits