Class Notes (834,966)
Canada (508,836)
CSC209H1 (41)
Karen Reid (20)
Lecture

jan16c.docx

1 Page
113 Views
Unlock Document

Department
Computer Science
Course
CSC209H1
Professor
Karen Reid
Semester
Winter

Description
 Job control  Dollar question mark and Conditionals o A job is a program whose execution has been initiated by the usero exit code of the previous command is stored in the shell parameter $? $ test -e file1 o At any moment, a job can be running or suspended o Foreground job: $ echo $?  A program which has control of the terminal 0 $ test -d file1 o Background job: $ echo $?  Runs concurrently with the parent shell and does not take contr1l of the keyboard $ cat announcers.test.txt one hen o Star a job in the background by appending & at the end of the call two ducks  Ex. ./joy & three squawking geese o Commands: ^Z, jobs, fg, bg, kill four Limerick oysters o Ex. joy five corpulent porpoises $ ls six pairs of Don Alversos tweezers Week1-2-Shell.key giant mistake.sh 7,000 Macedonians in full battle array shiftexample typescript announcers.test.txt eight brass monkeys from the ancient sacred crypts of happy.c name small_file Egypt argquotes joy overargs subs nine apathetic, sympathetic, diabetic old men on roller skates $ ./joy with a marked propensity toward procrastination and happyhappyhappyhappyhappyhappyhappyhappyhappyhappyhappy happyhappyhappyhappyhappyhappyhappyhappyhappyhappyhappy sloth ^C # this killed the job 10 lyrical, spherical, diabolical denizens of the deep $ ./joy who hall happyhappyhappyhappyhappyhappyhappyhappyhappyhappyhappy stall around the corner of the quo of the quay of the happyhappyhappyhappyhappy^Z # this stopped the job quivery, all at [1]+ Stopped ./joy the same time. $ jobs $ grep six announcers.test.txt six pairs of Don Alversos tweezers [1]+ Stopped ./joy $ grep six announcers.test.txt > output $ bg 1 [1]+ ./joy & $ cat output $ six pairs of Don Alversos tweezers happyhappyhappyhappyhappyhappyhappyhappyhappyhappyhappy $ grep six announcers.test.txt happyhappyhappyhappyhappyhappyhappyhappyhappyhappyhappy six pairs of Don Alversos tweezers happyhappylshappyhappyhappy $ echo $? Week1-2-Shell.key giant mistake.sh shiftexample 0 typescript $ grep seven announcers.test.txt $ echo $? announcers.test.txt happy.c name small_file 1 argquotes joy overargs subs $ $ if grep seven announcers.test.txt # checks $? == 0 happyhappyhappyhappyhappyhappyhappyhappyhappyhap
More Less

Related notes for CSC209H1

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit