Execute Shell Script doesn't work for me

I am trying to set up activating Anybar from KM.

However when running the example script from KM like so :

It doesn't work. However if I run the same line from my terminal, it works well.

Is there anything I can do to fix this?

Thank you for any help.

How do you know it is not working, it appears to run and do nothing for me in both cases.

BTW, it is helpful to include the shell command in the text, using a block quote (three back ticks) to avoid testers copy & paste issues:

echo -n "white" | nc -4u -w0 localhost 1738

If I run that, it appears to do nothing in both Execute Shell Script and the Terminal.

But I have no idea what GameGen1 (port 1738) is supposed to be doing.

Hey Nikita,

Keyboard Maestro’s default shell does not support the -n switch for echo.

echo -n "white"

Produces this output:

-n white

And that is not what Anybar expects.

Try this:

#!/usr/bin/env bash
echo -n "white" | nc -4u -w0 localhost 1738

-Chris

2 Likes

Thank you Chris. This worked. :slight_smile:

1 Like