[S1] grep

The grep(1) command can be use to detect or extract lots of information from text files. When working with source code, grep(1) can help you to find in which files some functions or constants have been defined. For this exercise, we will use the source code of the CUnit testing framework that you can download as a tar archive.


Question 1: CU_trim_left

In which file has the CU_trim_left been defined ? Answer with the name of the file.

Question 2: CU_UNREFERENCED_PARAMETER(pTest);

CU_UNREFERENCED_PARAMETER(pTest) appears in file Sources/Console/Console.c Can you indicate the line number of this command ?

Question 3: assert

The function assert is frequently used in the CUnit source code. Can you count the number of lines where assert appears in all the files of the working directory? (Hint: use wc(1))

Information

Author(s) Tom Rousseaux
Deadline No deadline
Submission limit No limitation
Category Tags Command line, S1

Sign in