1 / 0

V2012.13

V2012.13. Agenda. Old Business Delete Files New Business Week 12 Topics: Coming up: Hyland Field Trip: Feb 21 st Tiny Circuits/ Arduino Review/Demo Linux Intro (continued) Scripts/scripting. Future Meeting Preview. GAMING. OPERATING SYSTEM. NETWORK. PERIPHERALS. STORAGE. CLOUD.

avent
Download Presentation

V2012.13

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. V2012.13
  2. Agenda Old Business Delete Files New Business Week 12 Topics: Coming up: Hyland Field Trip: Feb 21st Tiny Circuits/Arduino Review/Demo Linux Intro (continued) Scripts/scripting
  3. Future Meeting Preview GAMING OPERATING SYSTEM NETWORK PERIPHERALS STORAGE CLOUD I/O DATA & DATABASES CPU NETWORK GRAPHICS GRAPHICS APP DEVELOPMENT VIRTUAL MEMORY LANGUAGES
  4. New Business Tiny Circuits/Arduino Review/Demo Getting Started w/ Arduino Simple Demos Intro to Linux Scripts/scripting Example
  5. Basic Commands Commands take the following form: <Command> <Switches> <Parameters> <Target> Switches: single letters, preceded by a hyphen, that adjust what the command does Parameters: things that the command needs to know in order to work Target: the thing (such as a file) that the command will be applied
  6. Basic Commands - grep grep
  7. 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
  8. Create Your First Script Output $ ./date.sh Fri Mar 8 13:27:05 EST 2013
  9. Create Your First Script Your Challenge: Let’s add some features Display only the date Display the Day
  10. Create Your First Script
  11. 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
  12. 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"
  13. 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";
More Related