<p dir="ltr">I would use a shell case statement. It should be much cleaner.</p>
<div class="gmail_quote">On May 14, 2014 3:45 PM, &quot;Gurucharan Shetty&quot; &lt;<a href="mailto:shettyg@nicira.com">shettyg@nicira.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How about making the following assumption?<br>
<br>
diff --git a/utilities/<a href="http://ovs-pki.in" target="_blank">ovs-pki.in</a> b/utilities/<a href="http://ovs-pki.in" target="_blank">ovs-pki.in</a><br>
index 7f56b4e..417fdf4 100755<br>
--- a/utilities/<a href="http://ovs-pki.in" target="_blank">ovs-pki.in</a><br>
+++ b/utilities/<a href="http://ovs-pki.in" target="_blank">ovs-pki.in</a><br>
@@ -461,7 +461,12 @@ sign_request() {<br>
     must_not_exist &quot;$2&quot;<br>
     pkidir_must_exist<br>
<br>
-    request_file=&quot;`pwd`/$1&quot;<br>
+    if [ &quot;`echo $1 | cut -c1`&quot; = &quot;/&quot; ]; then<br>
+        request_file=&quot;$1&quot;<br>
+    else<br>
+        request_file=&quot;`pwd`/$1&quot;<br>
+    fi<br>
+<br>
     (cd &quot;$pkidir/${type}ca&quot; &amp;&amp;<br>
      openssl ca -config ca.cnf -batch -in &quot;$request_file&quot;) \<br>
         &gt; &quot;$2.tmp$$&quot; 2&gt;&amp;3<br>
<br>
On Wed, May 14, 2014 at 12:58 PM, Ben Pfaff &lt;<a href="mailto:blp@nicira.com">blp@nicira.com</a>&gt; wrote:<br>
&gt; On May 14, 2014 11:35 AM, &quot;Gurucharan Shetty&quot; &lt;<a href="mailto:shettyg@nicira.com">shettyg@nicira.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Wed, May 14, 2014 at 11:18 AM, Ben Pfaff &lt;<a href="mailto:blp@nicira.com">blp@nicira.com</a>&gt; wrote:<br>
&gt;&gt; &gt; On Tue, May 13, 2014 at 09:03:18AM -0700, Gurucharan Shetty wrote:<br>
&gt;&gt; &gt;&gt; This lets us generate certs for unit tests on Windows<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Signed-off-by: Gurucharan Shetty &lt;<a href="mailto:gshetty@nicira.com">gshetty@nicira.com</a>&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This will fail if $1 is absolute (if it begins with /):<br>
&gt;&gt; &gt;&gt; +    request_file=&quot;`pwd`/$1&quot;<br>
&gt;&gt; Reading the man page gave me an impression that &#39;name&#39; is just a<br>
&gt;&gt; prefix. I guess not. I will fix it in v2.<br>
&gt;<br>
&gt; I think that it would most commonly be just a simple prefix, but i can<br>
&gt; imagine a script calling ovs-pki with a fully qualified name as that prefix.<br>
&gt; Since (I guess) this worked before, I&#39;d like it to continue working.<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Ben.<br>
</blockquote></div>