<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 8, 2013 at 10:48 AM, Paul Eggleton <span dir="ltr"><<a href="mailto:paul.eggleton@linux.intel.com" target="_blank">paul.eggleton@linux.intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Monday 08 April 2013 13:31:50 Trevor Woerner wrote:<br>
> On Fri, Apr 5, 2013 at 12:59 PM, Peter Kjellerstedt<br>
> <<a href="mailto:peter.kjellerstedt@axis.com">peter.kjellerstedt@axis.com</a>> wrote:<br>
> > +[ "${PATH#$NEWPATHS}" != "$PATH" ] || PATH="$NEWPATHS$PATH"<br>
><br>
> This is certainly a welcome addition in functionality, but it relies<br>
> on the pattern remaining at the start of the PATH (i.e. the user<br>
> hasn't played with PATH in any way). Could we not use the<br>
> ${parameter/pattern/string} parameter expansion instead (e.g.<br>
> "${PATH/$NEWPATHS/}") so it doesn't matter whether the user has<br>
> further modified the PATH?<br>
<br>
</div>Unfortunately I think this is specific to bash, so it may not be portable.<br>
Maybe the equivalent can be achieved with sed however.</blockquote></div><br>Also, neither version matches the : separator, which means we could in theory get false positive matches.<br>-- <br>Christopher Larson</div></div>