I need to use a bash script to delete full-line old-style
comments from a C program,
i.e., comments that begin (
/*) and end (
*/) on the same line,
with no code on the same line.
This is an example of what the C program looks like:
/* Comment 1 */ printf("It is /* Comment 2 */\n"); x = 5; /* Comment 3 */ /* Comment 4 */ /* Comment 5 */ y = 0; /* * Comment 6 */ // Comment 7
But I need it to look like this:
printf("It is /* Comment 2 */\n"); x = 5; /* Comment 3 */ /* Comment 5 */ y = 0; /* * Comment 6 */ // Comment 7
I do know how to delete all comments but just not sure on how to just remove certain ones.
The script should read inputs from a text file, and write outputs into another file, and all the I/O file names must be given in the command-line.