CSC%204630 - PowerPoint PPT Presentation

About This Presentation
Title:

CSC%204630

Description:

What do we expect from wc? Now, wc numbers? wc chars? Issues from Quiz (2) grep. Matching is a binary operation on the lines of a file. ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 6
Provided by: supp158
Category:
Tags: csc | chars

less

Transcript and Presenter's Notes

Title: CSC%204630


1
CSC 4630
  • Meeting 6
  • February 5, 2007

2
Issues from the Quiz
  • Text files and wc
  • File contains decimal digits, one per line. What
    do we expect from wc?
  • File contains two lines, the first with the 26
    upper case characters, the second with the 26
    lower case characters. What do we expect from
    wc?
  • Now, wc numbers? wc chars?

3
Issues from Quiz (2)
  • grep
  • Matching is a binary operation on the lines of a
    file.
  • cat (grep s file) (grep v s file) lt-gt file
  • Two negatives lead to confusion, but
  • grep s file is not a negative match. It asks
    for all lines that match some character that is
    not is s
  • grep a-c file asks for all lines that contain
    some character that is not an a, nor a b, nor a
    c. So it gets cat but not cab

4
More on grep
  • grep A-Z file gets ?
  • grep A-Za-z0-9 file gets ?
  • grep a-z file gets ?
  • grep aeiou file gets ?
  • grep 5-9 numbers wc produces ?

5
More on grep
  • Try grep v 5-9 numbers
  • What happened
  • In words,
  • grep v s file gives all lines in the file
    that dont contain a character that is not
    mentioned in s. Hence, all lines in the file
    that contain only mentioned characters.
Write a Comment
User Comments (0)
About PowerShow.com