[Remind-Fans] New feature coming in Remind - looking for testers

Dianne Skoll dianne at skoll.ca
Sun Sep 5 11:00:21 EDT 2021


Hi,

> I could see needing to escape them in remind, to allow for
> command-continuation such as

>   INCLUDECMD printf 'REM %s\n' [x] \
>     c d e

No. there's no need to escape them in Remind.  Remind does
command-continuation very early on.  However, your example above will
fail because Remind will include a literal newline in what it passes to
the shell, so the shell will see two commands:

     printf 'REM %s\n' a b
     c d e

so don't do that! :)

> If everything is passed literally, are there any helper shellescape()
> functions that can be used for quoting args, ensuring that they don't
> get munged when lexed by the shell?

No; it's up to you to handle that.  Trying to figure out which
characters need escaping on all kinds of different UNIXes seems to me
like an invitation to a Remind security flaw. :)

Anyway, I pushed some commits that fix your original case, so this
works:

    set mltest "a b"
    INCLUDECMD printf 'REM %s\n' [mltest]

and also, I added a new feature: If you prefix the command with "!",
then RUN is disabled for the output of the command.  For example, if
you're asking for reminders from a command you don't quite trust, you
can use:

    INCLUDECMD !not_trustworthy_script

and RUN will be disabled for all commands output by
not_trustworthy_script

(You can't use "RUN OFF" followed by INCLUDECMD because then the
INCLUDECMD itself will fail...)

Regards,

Dianne.


More information about the Remind-fans mailing list