A complete example of quoting an arbitrary value as a word in a shell script

2022-10-23 Thread Poor Yorick
Hi, Maybe this has been done before, but I couldn't find it on the nets. The example Makefile below illustrates how to quote an arbitrary value as a word in a shell script. One use case for this is to evaluate a value as a complete shell script, similar to .ONESHELL but allowing all shell fe

misinterpretation of shell $'...' escape form

2022-10-15 Thread Poor Yorick
Given the following Makefile, define newline endef define cmd1 thing1 thing2 endef help: echo '$(subst $(newline),'$$'\n'',$(cmd1))' .PHONY: help , on an Ubuntu 22.04 system, GNU Make 4.3, Bash 5.1.16(1), and the Makefile below, "make help" produces the following