Question: 1 . Write a grep command that will look for single - line comments in the both files ( log 3 . py and log

1. Write a grep command that will look for single-line comments in the both files (log3.py and log3.c). Note: a- Python single-line comments can start with # while C single-line comments start with //. b- Lines that start with #include or #define should not be matched. c- The matched single-comments should start with line; lines has code and end with a single-single line comment should not be matched. d- To simplify the BRE, you can use Linux pipelining to run two grep commands back-to-back where the matched lines by the first grep command are passed as input to the second grep command lines. e- You can use the -v option in grep to exclude lines that match the BRE instead of including them. For example, you can have the output from the first grep command match all lines that start with # or // and then exclude those lines that start with #include or #define in the second grep command.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!