I've the following code inside make
file which gets from command array of strings
apps := $(shell fxt run apps)
go:
@for v in $(apps) ; do \
echo inside recipe loop with sh command: $$v ; \
done
The command returns array like [app1 app2 appN]
(could be many apps inside)
But I need it to be app1 app2 appN
, any idea how to remove the array []
?
when I run make I got the following
inside recipe loop with sh command: [app
inside recipe loop with sh command: app2]
You simple can use
subst
command with empty replacement part to remove parts of your variable content like this:or using
filer-out
with:Instead the two replacement functions. Important: Keep a
space
between the brakets, asfilter-out
needs a list of words. So you have 2 words in the pattern part of the command here. Output:If the input has no space between
[
and the first word, you have to use thesubst
command.Maybe you like to concatenate both expressions in one ( but less readable ):