Preview

Positional Notation: Quiz

Satisfactory Essays
Open Document
Open Document
518 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Positional Notation: Quiz
ULI101 – Quiz 2-1

Student name: ______________________________________

ULI101 Section: _______________

This quiz is worth 2.5% of your course grade.

Maximum time allowed is 20 minutes.

See the sample test file

Instructions:

Provide grep commands according to the following criteria, working with a file called

'input'. With the exception of question #12, all questions are worth 2 marks.

1. Display all lines that are exactly 5 characters long:

grep “^.....$” input more elegant way to find a line of ‘n’ characters is grep –E “^.{n}$” input or

grep “^.\{n\}$” input (Must ‘escape’ { and } with \) or use egrep instead of grep –E

2. Display all lines that have at least one letter 'o' in them, upper- or lower-case:

grep –i “o” input or grep “[oO]” input

3. Display all lines with string 'or' followed by an 'ate' anywhere after that:

grep “or.*ate” input

4. Show all lines that do not start with a lower-case letter:

grep “^[^a-z]” input grep –v “^[a-z]” will show blank lines as well

5. Display all lines that do not have two letters 'r' following each other:

grep –v “rr” input

6. Count all blank lines:

grep –c “^$” input

7. Show all lines that end with a comma followed by a single digit:

grep “,[0-9]$” input

8. Show all lines that contain an asterisk (*):

grep “\*” input

9. Display lines that contain a phone number (for example: 647-555-1234):

grep –E “[0-9]{3}-[0-9]{3}-[0-9]{4}” input (if you use grep without –E you will have to ‘escape’ {} like in Q1)

10. (3 marks) Show lines containing numbers with a decimal point (for ex.: 23.123):

NOW, THIS ONE IS TOUGH AS YOU HAVE TO USE EITHER –E OPTION OR egrep. You gathered that {n} means

a repetition of n times. If you put {n,m} it means it repeats a minimum of ‘n’ and the maximum of ‘m’

times. Finally, and that is what we have to use here to find any decimal number (Michal does not specify

the format), {n, } means that it repeats a

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Nt1310 Unit 3 Maths

    • 552 Words
    • 3 Pages

    When multiplication and division is performed answers are rounded to the number of digits that corresponds to the least number of sig. figs in any of the numbers used in the calculation.…

    • 552 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Review Sheet 38 Physioex

    • 317 Words
    • 2 Pages

    6. 1) L,2) Y, 3) O, 4) C, 5) N, V, 6) W, 7) H, 8) D, T, Y, 9) B, 10) S, 11) H, 12) P, 13) I, 14) V, 15) E, 16) J, 17) X, 18) B, 19) V, 20) K, 21) T, 22) R, 23) U, 24) F, 25) Z, 26) Y, 27) A, 28) G…

    • 317 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Sequence A: AGA AGG GAG GAU UUG CAA GGU GGC CAA GAA UUA GGC GGC GGU CCC GGG GCG GGG AGU CUU CAA CCA…

    • 366 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    It is a mathematical expression in which a number is expressed as N x 10^n where N contains only one nonzero digit to the left of the decimal and n is an integer.…

    • 425 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Pm3110 Quiz 1

    • 1044 Words
    • 5 Pages

    _____ 9.Timers at a swim meet used four different clocks to time an event. Which recorded time is the…

    • 1044 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Assignment

    • 1058 Words
    • 5 Pages

    1) Initialization: the variable is initialized 2) Test: the loop tests the variable by comparing it to the maximum value 3) Increment: to increase the value during each iteration the loop increments the counter variable by adding 1 to it.…

    • 1058 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Ans: This matches a file with 4 characters, first is a number from 0 to 9, second is a lower case letter from a-z, third is a number from 0-9, and fourth is upper case letter from A-Z.…

    • 529 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    4. Use the Subtotal function to count the total number of records within each letter.…

    • 432 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Java Chapter 2 Quiz

    • 2047 Words
    • 9 Pages

    6. A(n) ____ is a value that is written into the code of a program.…

    • 2047 Words
    • 9 Pages
    Powerful Essays
  • Good Essays

    Chapter 8 Quiz

    • 469 Words
    • 2 Pages

    2. What is the term used for the number inside the bracket that specifies the number of values that an array can hold? (Points : 7)…

    • 469 Words
    • 2 Pages
    Good Essays
  • Good Essays

    A reasonable approach for an AD password policy, this will be determined by how, & what your ideas are and what your trying to accomplish. I know that you’d mention that a competitor has recently been hack into and security is the number one thing that should be addressed. This does not have to mean that you have to lose productivity over trying to secure your networks information. Simple measure like user names and passwords can be used to protect less sensitive information however how strong you make those usernames and passwords can have a great effect on how well your information is protected.…

    • 428 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Cda Resource File # 5

    • 680 Words
    • 3 Pages

    Identify the number of words in a short sentence. For example, “Pat has a cat. How many words are in that sentence?”…

    • 680 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    lolz

    • 480 Words
    • 4 Pages

    C. It will move the contents of temp1 from directory temp to temp1 of current directory and when finished it will erase the contents of temp1 of temp directory…

    • 480 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    File Processing Commands

    • 354 Words
    • 2 Pages

    Type in the command grep - - help to access the help manual. Using this information and the information from the text, how would you write a command to find the pattern 111 in a file called myfile.txt?…

    • 354 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Statistical Notation

    • 840 Words
    • 4 Pages

    Graham Hole, Research Skills 2012: page 1 APA format for statistical notation and other things: Statistical abbreviations: ANCOVA ANOVA α β Analysis of Covariance Analysis of Variance alpha, the probability of making a Type 1 error in hypothesis testing beta, the probability of making a Type 2 error in hypothesis testing CI d d’ df confidence interval Cohen’s measure of effect size d-prime (a measure of sensitivity, used in Signal Detection Theory) degrees of freedom F Fmax H Ha F-ratio (used in ANOVA, ANCOVA and MANOVA) Hartley’s Fmax test value (a test for homogeneity of variance)…

    • 840 Words
    • 4 Pages
    Good Essays

Related Topics