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