GNU Make shell function breaks when piped to cut -
hello have mve trying catenate 2 variables , pipe cut.
all: @echo $(app_name) @echo $(current_branch) @echo $(call eb_safe_name,$(current_branch)) @echo $(shell echo "$(app_name)-$(call eb_safe_name,$(current_branch))" | cut -c 23) output:
$ cicdtest $ issue#13-support-multi-branch $ issue-13-support-multi-branch $ o if remove | cut -c 23 output fine, need limit 23 char. doing wrong on 4th echo statement above?
different behavior in test script in make, issue explicit use of cut, not make. following works expected:
@echo $(shell echo $(app_name)-$(call eb_safe_name,$(current_branch)) | cut -c 1-23)
cut has handling incomplete range, in make (even though using bash) complete range needed:
bytes, characters, , fields are numbered starting @ 1 , separated commas. incomplete ranges can given: -m means 1-m ; n- means n through end of line or last field.
options
-b byte-list --bytes=byte-list print bytes in positions listed in byte-list. tabs , backspaces treated other character; take 1 byte.
-c character-list --characters=character-list print characters in positions listed in character-list. same `-b' now, internationalization change that. tabs , backspaces treated other character; take 1 character.
Comments
Post a Comment