How to run a shell script using Spotlight passing a parameter?
<p>It was mentioned that we can execute a shell script using spotlight renaming it as &quot;myscript.command&quot; as described <a href="https://stackoverflow.com/questions/2877741/how-to-run-a-shell-script-using-spotlight">here</a>. But is it possible to pass a parameter to the script when calling it from Spotlight?</p>
<p>For example:</p>
<p>Script <code>myscript.command</code>:</p>
<pre><code>#!/bin/bash
echo &quot;Parameter: $1&quot;
</code></pre>
<p>On Spotlight:</p>
<pre><code>myscript.command test
</code></pre>
<p>Output:</p>
<pre><code>(...)
Parameter: test
(...)
[Process completed]
</code></pre>