I have a makefile that contains this command:
sed '/^$/d'
when I ran it I got:
sed '/^d'
sed: -e expression #1, char 3: unterminated address regex
looks like it interprets the dollar sign, how can I prevent that from happening?
You have to double all dollar signs in a recipe, otherwise make treats them as introducing a make variable:
sed '/^$$/d'
If you search for "dollar sign makefile" or similar you'll find tens if not hundreds of answers to virtually this exact question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With