Hi !
I'm working on a shell which delete the coments of .sh files. I can't figure how to do it :/
So I ask for help, here are the rules :
Lines starting by # have to be deleted but if there is $ or \ before it has to stay.
Thanks ! :)
>>53644969
Run it by python readlines and analyze
if line starts with # or if within a line there's # and some preceding text
or get some regex master
Yeah, doing it in Python wouldn't be too hard.. But I have to do it in bash :/
sed -i 's/[^\\$]#//g;/^#/d' foo.sh
DON'T POST FULL ANSWER OP IS TOO DUMB TO DO HIS HOMEWORK, YOU'RE NOT HIS PERSONAL TUTOR
grep -Ev "\s*#.*"
>>53645134
Thanks !
>>53645156
Fuck off!