150 likes | 300 Views
V2012.13. Agenda. Old Business Delete Files New Business Week 13 Topics : Website Help Hyland Field Trip Review Coding Video First Coding Session Linux Scripts Review. Website Help. Meeting with Blessing House on 3/14 http://www.blessinghouse.org /
E N D
Agenda • Old Business • Delete Files • New Business • Week 13 Topics: • Website Help • Hyland Field Trip Review • Coding Video • First Coding Session • Linux Scripts Review
Website Help • Meeting with Blessing House on 3/14 • http://www.blessinghouse.org/ • There are similar organizations like http://www.provhouse.org/ that they are willing to use a guides or ideas • What we are trying to accomplish: • Newer look and feel • Easy to maintain • Easy to add new content
Hyland Field Trip • Hyland Field Trip Review • Your thoughts? • Culture and environment • Was it worthwhile? • What did you learn during the mentoring session? • Donation!
Interested …? • First Session • Nine Weeks • Exercises, Assignments • What You’ll Learn • HTML Basics • CSS • We’ll Use Code Academy • http://www.codecademy.com/learn • http://www.codecademy.com/tracks/afterschool-semester1
Scripting Review • Intro to Linux Review • Scripts/scripting
Create Your First Script • Open a text editor • Menu->Accessories->gedit • Scripts always begin with: #! /bin/bash • Save your script (date.sh) • Make the script executable $ chmod +x date.sh • Run your script $ ./date.sh
Create Your First Script • Output $ ./date.sh Fri Mar 8 13:27:05 EST 2013
Create Your First Script • Your Challenge: • Let’s add some features • Display only the date • Display the Day
Create Your First Script (date.sh) • Output $ ./date.sh Today's date is: March 8 The day of the week is: Friday The year is: 2013 The complete date is: Friday, March 8, 2013
Create Your First Script (date.sh) #!/bin/sh echo -n "Today's date is: "; date +"%B %-d" echo -n "The day of the week is: "; date +"%A" echo -n "The year is: "; date +"%Y" echo -n "The complete date is: "; date +"%A, %B %-d, %Y"
Script to Display Memory (mem.sh) #! /bin/bash # Total memory space details echo "Memory Space Details" free -t -m | grep "Total" | awk '{ print "Total Memory space : "$2 " MB"; print "Used Memory Space : "$3" MB"; print "Free Memory : "$4" MB"; }' echo "Swap memory Details" free -t -m | grep "Swap" | awk '{ print "Total Swap space : "$2 " MB"; print "Used Swap Space : "$3" MB"; print "Free Swap : "$4" MB";