[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sed? insanity

Clint Adams <schizo@debian.org> writes:

> This is driving me batty.  Can anyone tell me what's broken here?

Nice one.

The make within a make (even though the sub-make is in a shell script)
prints out 'make entering directory /tmp...', which becomes part of
that shell scripts $t, which is why sed doesn't understand the command
'm' (the first letter of 'make entering...').

You can see (after wading through the output) exactly how it happens
by running

  make -r -d -f maketest test

(-r tells it not to try any built-in rules, lessening the output,
the -d, tells it to run in 'debug' mode letting us see what it does
step by step).

The fix (one fix, anyway) is to tell that inside make to be "silent"
(-s) like this:
t=`make -s -f - <<EOF
        @echo $weird

Reply to: