<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">&lt;<a href="mailto:paul.eggleton@linux.intel.com" target="_blank">paul.eggleton@linux.intel.com</a>&gt;</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>
&gt; On Fri, Apr 5, 2013 at 12:59 PM, Peter Kjellerstedt<br>
&gt; &lt;<a href="mailto:peter.kjellerstedt@axis.com">peter.kjellerstedt@axis.com</a>&gt; wrote:<br>
&gt; &gt; +[ &quot;${PATH#$NEWPATHS}&quot; != &quot;$PATH&quot; ] || PATH=&quot;$NEWPATHS$PATH&quot;<br>
&gt;<br>
&gt; This is certainly a welcome addition in functionality, but it relies<br>
&gt; on the pattern remaining at the start of the PATH (i.e. the user<br>
&gt; hasn&#39;t played with PATH in any way). Could we not use the<br>
&gt; ${parameter/pattern/string} parameter expansion instead (e.g.<br>
&gt; &quot;${PATH/$NEWPATHS/}&quot;) so it doesn&#39;t matter whether the user has<br>
&gt; 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>