mdlbear: (technonerdmonster)
mdlbear ([personal profile] mdlbear) wrote 2018-12-31 04:13 pm (UTC)

There was another bug: I had to change the single quotes around the sed command to double quotes so that $url could get expanded -- that required using "\\\\n" instead of "\n" to make a newline.

If you want to follow along, bear in mind that things that look like $(XXXX) are expanded by make. Shell variables look like $XXXX, but to get a dollar sign into the shell portion of the recipe you have to double it -- $ is a make variable -- constant, actually -- that contains '$'.

The final make recipe is:

post:	pre-post
	url=$$($(POSTCMD) $(ENTRY));					\
	   sed -i -e "1,/^$$/ s@^$$@Posted:  $(POSTED) $$url\\\\n@" $(ENTRY)
	rm -f .draft
	git add $(ENTRY)
	git commit -m "posted $(ENTRY)" -a


Post a comment in response:

This account has disabled anonymous posting.
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org