For 01-cp-rm-via-SHELL.patch, its not good that a complex check is repeated before every COPY invocation. The command shells have different rules for things like quoting and brace expansion. The following produce different results with cmd and bash: echo "" echo \\ echo a{b,c} I don't know how safe these are on older Unix shells but something like this appears possible: ifeq (\,$(shell echo \\)) BASH = 1 endif