Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a simeple program in C (intro class) as you requested: Write program simple_grep.c that reads entire lines from the user, and only prints back
Write a simeple program in C (intro class)
as you requested:
Write program simple_grep.c that reads entire lines from the user, and only prints back those which match any of the patterns received as program arguments, as illustrated in the following example.
$ cat udhr_art26.txt (1) Everyone has the right to education. Education shall be free, at least in the elementary and fundamental stages. Elementary education shall be compulsory. Technical and professional education shall be made generally available and higher education shall be equally accessible to all on the basis of merit. (2) Education shall be directed to the full development of the human personality and to the strengthening of respect for human rights and fundamental freedoms. It shall promote understanding, tolerance and friendship among all nations, racial or religious groups, and shall further the activities of the United Nations for the maintenance of peace. (3) Parents have a prior right to choose the kind of education that shall be given to their children. $ ./simple_grep right FREEDOM "their children" 4.1 Simple grep First t released 43 years ago (). grep is one of the oldest command-line utilities in the UNIX ecosystem. grep is used to print the lines that it receives if they match a certain pattern. This tool makes it possible to detect if a file contains a certain word for example, and if so, optionally at which line(s). Write program simple_grep.c that reads entire lines from the user, and only prints back those which match any of the patterns received as program arguments, as illustrated in the following example. ? cat udhr_art2 6 . txt (1) Everyone has the right to education. Education shall free, at least in the elementary and fundamental stages Elomontary education shal1 be compulsory.Technical and professional education shall be made generally available and higher education shall be equally accessible to all on the basia of merit. (2) Education shall be directed to the full development of the human personality and to the ast.rengthening of respect for human rights and fundamental freedoms. It shal1 promote
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started