It would be helpful if the KM Editor could give one of its little warnings when $KMVAR appears in a Execute a Shell Script without an immediately preceding (single or double) quote mark.
It is highly unlikely that the string $KMVAR would appear in a shell script other than when it is being used at the start of a variable name, and, in those circumstances, omitting the quote marks will produce an error.
I'm not sure I understand, so I went through my macros and found that 75% of my Execute Shell Script actions do NOT have any quotes around my use of $KMVAR. Here's one example:
Yes, sorry, I made a mistake there. I had been working for a very long time on a (too complicated!) macro in which I was using variables for paths with spaces and forgot that that case was why I had got into the habit of always using quotes!