in reply to In place replacement from reference list

this can't be solved exactly if you have ambiguous paths, like
/a/b/cd/e.sh /a/b/c/de.sh

both will produce /a/b/cde.sh

But which one is correct?

You will need to check all possible included paths and then if the "remaining" file exists.

Once you have multiple hits, you'll need to use heuristics.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery