%% Donn Terry <[EMAIL PROTECTED]> writes:

  dt> Please take a look at the Makefile in that area; the
  dt> current code is using nested `` to create further command
  dt> lines (not data files).  I'll admit I haven't tried, but
  dt> I'm not at all sure it can be done because the *creation*
  dt> of the string occurs in a different directory than the
  dt> *use* of it, and the purpose of the substitution is to
  dt> deal with that problem!  Here's what I currently use
  dt> locally (with $()).  If you can figure out a decent
  dt> (and generally acceptable) solution to the problem that
  dt> works with ``, I'll be more than happy to see it.

  dt> PREPEND_DOTDOT_TO_RELATIVE_PATHS = sed \
  dt>         -e 's|^ *[^ /][^ /]*/|%&|' \
  dt>         -e 's| -B| -B%|g' \
  dt>         -e 's|% *[^- /]|%&|g' \
  dt>         -e 's|%% *|../|g' \
  dt>         -e 's|%||g'

I'm a little concerned that the & token isn't supported by all versions
of sed, either, but I couldn't find any examples... anyone have thoughts
on the portability of that?

  dt>         "CC=$$(echo $$(case '$(CC)' in (stage*) echo '$(CC)' | sed -e \
  dt> 's|stage|../stage|g';; (*) echo '$(CC)';; esac) | \
  dt> $(PREPEND_DOTDOT_TO_RELATIVE_PATHS) )"

Hmm.  Why can't you do this with just one ``?  There's no need for the
outer one and the outer echo at all as far as I can see, just pipe the
results of the case statement directly into the sed script, like this:

  "CC=`case '$(CC)' in stage*) echo '$(CC)' | sed -e 's|stage|../stage|g';; \
                       *)      echo '$(CC)';; \
       esac | $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`"

?

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.

Reply via email to