From 4b0959458c821ef26990fe1fe5931d552512526d Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 23 May 2020 23:20:31 +0000 Subject: makefile_escaping: set up CI --- makefile_escaping/shell.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 makefile_escaping/shell.mk (limited to 'makefile_escaping/shell.mk') diff --git a/makefile_escaping/shell.mk b/makefile_escaping/shell.mk new file mode 100644 index 0000000..36db8d8 --- /dev/null +++ b/makefile_escaping/shell.mk @@ -0,0 +1,14 @@ +escape = $(subst ','\'',$(1)) + +cwd := $(shell basename -- "$$( pwd )") +export cwd + +echo_cwd := printf '%s\n' '$(call escape,$(cwd))' +bash_cwd := bash -c '$(call escape,$(echo_cwd))' + +.PHONY: test +test: + @printf '%s\n' '$(call escape,$(cwd))' + @printf '%s\n' "$$cwd" + @bash -c '$(call escape,$(echo_cwd))' + @bash -c '$(call escape,$(bash_cwd))' -- cgit v1.2.3