Home | History | Annotate | Download | only in config

Lines Matching refs:escape

8 # nl-escape
10 # Usage: escape = $(call nl-escape[,escape])
16 nl-escape = $(or $(1),m822df3020w6a44id34bt574ctac44eb9f4n)
18 # escape-nl
20 # Usage: escaped-text = $(call escape-nl,text[,escape])
32 escape-nl = $(subst $(newline),$(call nl-escape,$(2)),$(1))
36 # Usage: text = $(call unescape-nl,escaped-text[,escape])
38 # See escape-nl.
40 unescape-nl = $(subst $(call nl-escape,$(2)),$(newline),$(1))
42 # shell-escape-nl
44 # Usage: $(shell some-command | $(call shell-escape-nl[,escape]))
46 # Use this to escape newlines from within a shell call;
47 # the default escape is a bizarre string.
49 # NOTE: The escape is used directly as a string constant
54 define shell-escape-nl
55 awk 'NR==1 {t=$$0} NR>1 {t=t "$(nl-escape)" $$0} END {printf t}'
60 # Usage: $(shell some-command | $(call shell-unescape-nl[,escape]))
63 # the default escape is a bizarre string.
65 # NOTE: The escape is used directly as an extended regular
75 awk 'NR==1 {t=$$0} NR>1 {t=t "\n" $$0} END { gsub(/$(nl-escape)/,"\n",t); printf t }'
78 # escape-for-shell-sq
80 # Usage: embeddable-text = $(call escape-for-shell-sq,text)
86 escape-for-shell-sq = $(subst ','\'',$(1))
92 shell-sq = '$(escape-for-shell-sq)'
128 "$$(echo $(call escape-nl,$(shell-sq),$(2)) | $(call shell-unescape-nl,$(2)))"
145 _l-sh = $(call shell-sq,command -v $(shell-sq) | $(call shell-escape-nl,))