如何使用Spotlight传递参数来运行shell脚本?

Art*_*oly 6 macos shell spotlight

有人提到,我们可以使用聚光灯将其改名为形容为"myscript.command"执行shell脚本这里.但是从Spotlight调用它时是否可以将参数传递给脚本?

例如:

脚本myscript.command:

#!/bin/bash
echo "Parameter: " $1
Run Code Online (Sandbox Code Playgroud)

在Spotlight上:

myscript.command test
Run Code Online (Sandbox Code Playgroud)

输出:

(...)
Parameter: test
(...)
[Process completed]
Run Code Online (Sandbox Code Playgroud)

tri*_*eee 2

不,目前看来还不可能。