How Do I Pass a KM Variable to the Execute Shell Script Action?

It looks like the execute a script in terminal don't recognize tokens like %TriggerValue% etc...
How can I pass the KM variable to the script parameter?

You could easily assign the token to a variable first, then pass the variable to the action.

I tried that. It didn't work either.

Oh, I understand now. I thought you were trying to pass a variable to a macro. I'm sorry. You are trying to pass it to a shell script. That's not how you pass variables to shell scripts. Instead of saying %Variable%% you say it like this: $KMVAR_varname.

It's usually that simple. But there are some cases where that won't work. Since you haven't told me exactly what your script is doing, I can't tell you exactly how to specify the variable. It gets tricky because many shell commands take quotes. There are some variations to how you handle those cases.

There are two methods:

  1. As @Sleepy suggested. For more info see Using KM Variables in a Execute a Shell Script action
  2. Enter any KM Token in the "With input from" parameter of the Execute Shell Script