Hello Unix board community,
I have to program a shell script, but I am a complete noob so I hope I get some help here. The assignment is as follows:
The program removes all comments regardless of formatting or language from files with specific file name extensions (php, css, js, ...).
Optional an own parameter file, which contains a list of file name extensions shall be provided. Optional the source and destination directory shall be provided.
How to start the script:
removecomment <file> [-L list] [-s sourcedir] [-d destinationdir]
The text without the comments is output to stdout
So, the list contains the comment syntax for each file name extension. What would be the best way to store the information into the list?
What do the -L -s -d mean and how do I use them in my script?
For the actual cutting I tried to do something like this
cut -d "#" -f1 withcomments.txt
But this is still hard coded and not distinct to the file name extension...
I don't really know where to start, I hope someone can help me.
With kind regards TheZeusMan