Execute a Script in Terminal

OK, here is a new version:

Execute a Script in Terminal-v200.zip (15.6 KB)

You can paste your KM variables to the second text field (“KM variables”). To use them in your script call them with $km1, $km2, etc. in the order they are listed in the Variables field.

Example:

…produces this output:



Treat this as a beta version! I haven’t done much testing.

Before using it with file-system-changing commands like rm or mv please test it with something harmless like echo or ls !

Notes:

  • If you are using the action without any variables you can leave the explanatory text in the field. It will be ignored.
  • Empty lines in the Variables field or trailing newlines will be ignored.
  • Empty or undefined variables will not be ignored, they will become empty strings in the shell script.
  • If you prefer to see an alert if a variable is empty/undefined, this can easily be implemented. But I think in general it is good to have the possibility to run the action also with intentionally empty variables.
6 Likes