lec06 - CS114 Lecture 6 sed awk HW2 due tonight No lecture...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CS114: Lecture 6 HW2 due tonight No lecture Monday (Fall Break)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Redirection echo something > outputfile If outputfile existed before, old file is deleted! New file created; contents = something echo anything >> outputfile anything appended to outputfile outputfile is now something anything tr 'a-z' 'A-Z' < inputfile inputfile needs to exist
Background image of page 2
Shell variables When do variables need $ and when not? $foo -> replaced by shell with value of foo variable echo “My favorite color is $foo” ls $PWD/bar set foo = . .. / setenv foo . .. Shell variables aren't declared When you set the value, it doesn't matter whether or not had value before
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What if I want to . ..? Strip directory prefixes from paths Print column 2, 4, and 7 of a file Remove comments from a shell script Convert from a DOS to UNIX text file Answer: write a Java program NO! sed, awk (or perl, python, .
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/04/2008 for the course CS 2110 taught by Professor Francis during the Spring '07 term at Cornell.

Page1 / 12

lec06 - CS114 Lecture 6 sed awk HW2 due tonight No lecture...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online