On Wed, Oct 12, 2011 at 7:43 AM, Martin d'Anjou <[email protected]> wrote: > I am not sure whether this is a make or shell problem.
Neither. > SHELL=/bin/bash > all: > $$'shopt -s extglob; ls !(foo)' > > make > $'shopt -s extglob\nls !(foo)\n' > /bin/sh: shopt -s extglob > ls !(foo) > : command not found > make: *** [all] Error 127 > > > But when I type it in the shell, it just works: > bash -c $'shopt -s extglob\n ls !(foo)\n' That last line works because the $'...' word is subject to a round of expansion by the shell you typed it in, *NOT* by the bash command that is literally being run there. It's as if you created a shell script that contained these two lines: #!/bin/bash $'shopt -s extglob\n ls !(foo)\n' Do you see how that gets one less round of shell expansion than your bash -c ... command? The makefile version is like the shell script, lacking that outermost round of shell expansion. Philip Guenther _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
