How to select and read #define lines from a code file
I would like to read a .m file
and select the lines which begins with '#define PL-KEY', like
{quote}
#define PL-KEYTAG TAG_values
#define PL-KEYGROUP GROUP_value
#define PL-KEYINFO "INFO_ValueTxtMax120Char" // could be max 120 char
..... more PL-KEY keys
{quote}
and put the rest of that line until a '//' or '/*' , like
{quote}
TAG TAG_values
GROUP GROUP_value
INFO "INFO_ValueTxtMax120Char"
{quote}
into something like a list where my code above will loop through.
I thought using something like
cat "path/to/code.h" | while read line
do
#... what do I have to with "$line" ...
if [[ "$line" == #define PL-KEY* ]] ; then
# yes then... then what????
done
any suggestions?? I noticed today, I am still no shell expert 😟
Thanks again