I have a small script which should print a couple of calls to a makefile i got.mylist='$(call list_samples,AON_9,NT_1,SC_17) $(call list_samples,AON_10,NT_2,SC_18) $(call list_samples,AON_11,NT_3,SC_19) $(call list_samples,AON_12,NT_4,SC_20) $(call list_samples,AON_13,NT_5,SC_21) $(call list_samples,AON_14,NT_6,SC_22) $(call list_samples,AON_15,NT_7,SC_23) $(call list_samples,AON_16,NT_8,SC_24)'for SAMPLES_OUT in $mylist;doecho $SAMPLES_OUTdoneOutput:$(calllist_samples,AON_9,NT_1,SC_17)$(calllist_samples,AON_10,NT_2,SC_18)$(calllist_samples,AON_11,NT_3,SC_19)$(calllist_samples,AON_12,NT_4,SC_20)$(calllist_samples,AON_13,NT_5,SC_21)$(calllist_samples,AON_14,NT_6,SC_22)$(calllist_samples,AON_15,NT_7,SC_23)$(calllist_samples,AON_16,NT_8,SC_24)the problem i am experiencing is that the for loop is splitting on spaces and therefor the $call and list_samples are taken apart while they should be actually one call. like this:$(call list_samples,AON_9,NT_1,SC_17)$(call list_samples,AON_10,NT_2,SC_18)$(call list_samples,AON_11,NT_3,SC_19)$(call list_samples,AON_12,NT_4,SC_20)$(call list_samples,AON_13,NT_5,SC_21)$(call list_samples,AON_14,NT_6,SC_22)$(call list_samples,AON_15,NT_7,SC_23)$(call list_samples,AON_16,NT_8,SC_24)I have tried putting the strings in  but that does not work since it is a list created with '' it sees everything between that as a string. Any hints are appreciated. Thanks!
for loop over a list
bash;for
You need to use an array to keep the elements together:mylist=(    '$(call list_samples,AON_9,NT_1,SC_17)'    '$(call list_samples,AON_10,NT_2,SC_18)'    '$(call list_samples,AON_11,NT_3,SC_19)'    '$(call list_samples,AON_12,NT_4,SC_20)'    '$(call list_samples,AON_13,NT_5,SC_21)'    '$(call list_samples,AON_14,NT_6,SC_22)'    '$(call list_samples,AON_15,NT_7,SC_23)'    '$(call list_samples,AON_16,NT_8,SC_24)')for SAMPLES_OUT in ${mylist[@]}    # crucial to use quotes heredo    echo $SAMPLES_OUTdone