Simon icon Simon
Flexible server monitoring

Simon 5 is coming soon!

Simon version 5 is currently in beta testing. It is a massive update, introducing a much-requested feature: syncing the Simon data between multiple Macs, plus a Simon Status service, a Link Checker filter, improved Find filter, iMessage and Speak Error notifiers, a new app icon, and much more.

Important: please note that Simon 5 requires a minimum of macOS 10.12 (Sierra), and will be a paid upgrade from Simon 4 after the beta. Purchasers since September 1, 2020 automatically get a version 5 license (that also works in previous versions).

Read the blog for details.

Simon shell Script filter: how to get the complete, unmodified input text

is it possible in a Simon shell script filter (any of zsh/sh/ksh/bash/tcsh/csh would be ok, probably even python would be ok) to pipe the complete, unmodified input text to some kind of utility, in a way similar to:

echo "{FilterInputText}" | myutility

This looks the right way, except when FilterInputText contains such characters as quotes, dollar, ampersand, (e.g. HTML code).

echo '{FilterInputText}'  | myutility

will also fail if single or double quotes are present in input text, not speaking of $, & and < >.

cat <<THISISMYENDOFFILEMARKER | /usr/local/bin/myutility

also breaks with some special chars in input text (such as backquote etc).

The script's stdin is not set to the input text, either.

This is a recurrent issue in all shells, and it has NO shell-level solution.

Does Simon include some way to solve this? Such as escaped string/environment variable/temp file/<insert some idea here>? If not, I hope it will in a (near-)future release...

Thanks in advance,

David Sinclair's picture

Re: Simon shell Script filter: how to get the complete, ...

Hi Pascal,

There isn't an escaped variation of the variable, but you could achieve this via another filter (or filters) prior to this one, using a Find-based filter to use a regular expression to replace quotes with escaped quotes, etc.

Hope this helps.