Cs288 Intensive Programming in Linux

Slides:



Advertisements
Similar presentations
The Basics!. Know the requirements of the ICT IGCSE Understand the need for extensive reading & research Be able to describe the difference between data.
Advertisements

Introduction to Unix – CS 21 Lecture 11. Lecture Overview Shell Programming Variable Discussion Command line parameters Arithmetic Discussion Control.
Links and Comments.
Find Command Characteristics –Locate files descending from multiple starting points –Employs regular expressions Examples On entire system: >find / -name.
Project 1CS-3013 A-term Programming Project #1 Forking Processes Due Tuesday, September 8, 11:59 PM.
Programming project #4 1 CS502 Spring 2006 Programming Project #4 Web Server CS-502 Operating Systems Spring 2006.
Overview of C++ Chapter 2 in both books programs from books keycode for lab: get Program 1 from web test files.
Shell Programming Learning Objectives: 1. To understand the some basic utilities of UNIX File 2. To compare UNIX shell and popular shell 3. To learn the.
BIF703 Redirection Continued: Pipes. Redirection Recall from the previous slides we defined stdin, stdout, and stderr and we learned how to redirect these.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note- taking materials.
Shell Control Structures CSE 2031 Fall August 2015.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
1 Operating Systems Lecture 3 Shell Scripts. 2 Shell Programming 1.Shell scripts must be marked as executable: chmod a+x myScript 2. Use # to start a.
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
CS 122 Engineering Computation Lab Lab 2 Dan De Sousa and Tim Cheeseman Department of Computer Science Drexel University April 2009 ©By the author. All.
Introductory Page for Teachers Logon to Quia and begin your exploration at this page.
Project 1, Command Shell CS-502 (EMC) Fall Programming Project #1 Command Shell CS-502, Operating Systems EMC, Fall 2009 (Slides include materials.
1 ADVANCED MICROSOFT EXCEL Lesson 9 Applying Advanced Worksheets and Charts Options.
CMPSC 60: Week 6 Discussion Originally Created By: Jason Wither Updated and Modified By: Ryan Dixon University of California Santa Barbara.
#!/bin/sh echo Hello World cat Firstshellscript.sh Firstshellscript.sh.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
CS 330 Programming Languages 10 / 07 / 2008 Instructor: Michael Eckmann.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Shell Programming Learning Objectives: 1. To understand the some basic utilities of UNIX File 2. To compare UNIX shell and popular shell 3. To learn the.
©Colin Jamison 2004 Shell scripting in Linux Colin Jamison.
Program #2 Algorithm for Parking at PSU. Understanding the Assignment You will be writing a program to find out how much someone at PSU might be spending.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Agenda Positional Parameters / Continued... Command Substitution Bourne Shell / Bash Shell / Korn Shell Mathematical Expressions Bourne Shell / Bash Shell.
CENG 476 Projects 2014 (10’th November 2014) 1. Projects One problem for each student One problem for each student 2.
Linux+ Guide to Linux Certification, Second Edition
If condition1 then statements elif condition2 more statements […] else even more statements fi.
Group, group, group One after the other: cmd1 ; cmd2 One or both: cmd1 && cmd2 Only one of them: cmd1 || cmd2 Cuddling (there):( cmd1 ; cmd2 ) Cuddling.
Assigning Values 1. $ set One Two Three [Enter] $echo $1 $2 $3 [Enter] 2. $set `date` [Enter] $echo $1 $2 $3 [Enter] 3. $echo $1 $2 $3 $4 $5 $6 [Enter]
PHP Syntax You cannot view the PHP source code by selecting "View source" in the browser - you will only see the output from the PHP file, which is plain.
Compunet Corporation Introduction to Unix (CA263) Round and Round By Tariq Ibn Aziz Dammam Community College.
2 nd Intro to Shell Scripting. Dates for Last Week of Class Homework 7 – Due Tuesday 5/1 by midnight Labs 7 & 8 or late ones – 8 is extra credit – Due.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
1 UNIX Operating Systems II Part 2: Shell Scripting Instructor: Stan Isaacs.
Linux Administration Working with the BASH Shell.
Introduction to Scripting Workshop February 23, 2016.
Shell Control Structures CSE 2031 Fall June 2016.
1 Project 12: Cars from File. This is an extension of Project 11, Car Class You may use the posted solution for Project 11 as a starting point for this.
CIS 115 Slingshot Academy / cis115.com
Cs288 Intensive Programming in Linux
cs Intensive Programming in Linux spring 2017
Cs288 Intensive Programming in Linux
Cs288 Intensive Programming in Linux
Cs288 Intensive Programming in Linux
Cs288 Intensive Programming in Linux
Running the Operational Codes for the Brahmaputra
CMSC201 Computer Science I for Majors Lecture 13 – Midterm Review
COMP 2710 Software Construction Homework 2 – Design and Algorithm
Cs288 Intensive Programming in Linux
The Development Environment and Your First C Program
CMSC201 Computer Science I for Majors Lecture 13 – Midterm Review
Function- A pairing of inputs with outputs such that each input is paired with exactly one output. (the inputs can’t repeat) Domain- inputs or x values.
Intro to PHP & Variables
What is Bash Shell Scripting?
Building Web Applications
Unix Talk #2 grep/egrep/fgrep (maybe add more to this one….)
Programming Project #1 Command Shell
awk- An Advanced Filter
Programming Project #1 Fork and Command Shell
Linux Shell Script Programming
CISC101 Reminders Assignment 3 due next Friday. Winter 2019
Shell Control Structures
Shell Control Structures
Introduction Andrew Whitaker
Introduction to Bash Programming, part 3
Presentation transcript:

Cs288 Intensive Programming in Linux Instructor: C F Yurkoski Christopher.f.yurkoski@njit.edu Section web site: https://web.njit.edu/~yurkowsk/cs288.html Class 5 (going to slowly?) 6-9-15

https://xkcd.com/844/ 6-9-15 cfy

Quiz results Written section 18% Programming sections 10% Overall 14% Lessons learn: leave yourself time to submit your code to Moodle Submit something, even partial credit is better than nothing. We need more electrical outlets in here. 6-9-15 cfy

Homework results Homework 1 average grade 72% Homework 2 70% 6-9-15 cfy

revu 6-9-15 cfy

sample output ./analysis https://web.njit.edu/~yurkowsk/29sept/competitorA https://web.njit.edu/~yurkowsk/29sept/competitorB customerA buys routers and switches customerF buys servers customerG buys routers afsconnect1-159 homework3 >: 6-9-15 cfy

Homework 6 revu part 1: # homework 6 if [ $# -ne 2 ] then echo Usage: $0 competitor1 competitor2 exit 1 fi wget -q $1 -O one wget -q $2 -O two 6-9-15

Homework revu cont cont: cat one | cut -d"," -f 1 | while read customer do grep $customer two done | cut -d"," -f 1 | while read commoncust a=`grep $commoncust one | cut -d"," -f 2` b=`grep $commoncust two | cut -d"," -f 2` let total=a+b if [ $total -gt 100000 ] then echo -n "$commoncust buys " prod1=`grep $commoncust one |cut -d"," -f 3` prod2=`grep $commoncust two |cut -d"," -f 3` if [ $prod1 != $prod2 ] echo $prod1 and $prod2 else echo $prod1 fi done 6-9-15

Complete solution at: https://web.njit.edu/~yurkowsk/x/analysis 6-9-15 cfy

Homework for next week Generalize solution from last week’s homework so that instead of accepting two arguments it accepts an arbitrary number of them. Change the threshold for a potential sales lead from $100,000 to 1,000,000 USD. List the potential sales leads and the products they purchase. Example output: 6-9-15 cfy

/analysis2 https://web. njit /analysis2 https://web.njit.edu/~yurkowsk/29sept/competitorA https://web.njit.edu/~yurkowsk/29sept/competitorB https://web.njit.edu/~yurkowsk/29sept/competitorC https://web.njit.edu/~yurkowsk/29sept/competitorD https://web.njit.edu/~yurkowsk/29sept/competitorE The big spenders are customerA customerD customerG customerH. customerA buys: routers switches customerD buys: customerG buys: customerH buys: afsconnect1-133 ~ >: 6-9-15 cfy

Project revu 6-9-15

In https://web.njit.edu/~yurkowsk/project1/ there are 4 files: https://web.njit.edu/~yurkowsk/project1/names https://web.njit.edu/~yurkowsk/project1/ids https://web.njit.edu/~yurkowsk/project1/hours and https://web.njit.edu/~yurkowsk/project1/rate names contains a list of names, one per line. id contains a list of semicolon separated tuples, one per line consisting of a name and  the literal "ID" followed by a numeric id.. hours  contains list of semicolon separated tuples, one per line consisting of a numeric id and a number indicating the number hours worked that week. rate  contains list of semicolon separated tuples, one per line consisting of a numeric id and an hourly rate for that id.  Assume the rate is USD per hour. Your goal is to write a script which calculates the compensation for the names in first file for the week and output the names followed by a tab followed by a dollar sign followed by that name’s pay. Output one name and pay amount per line.  The output should be in alphabetical order by name regardless of the order in the “names” file. Write the results to standard out, output  any error messages to standard error. Your script should accept 5 command line arguments.   The first will be the name of a directory like the one above,  the next 4  are assumed be file names in that directory whose contents are formatted as the four URLs above and are in the same order as above.

https://web.njit.edu/~yurkowsk/x/projectone 6-9-15 cfy

6-9-15 cfy

6-9-15 cfy

6-9-15 cfy

Test1 part 1 written Closed book 30 minutes, tests will not be accepted late. For question 6 assume the file input contains the same contents as in question 1. 6-9-15 cfy

Test part 2, problems on moodle. 6-9-15 cfy