[neomutt-users] Too few arguments on folder-hook

Kenneth Flak kennethflak at protonmail.com
Mon Nov 4 18:01:44 CET 2019


Thanks a lot! Will give it a spin when I’m back in front of my machine tomorrow.

K

Roosna & Flak - Contemporary Dance & Music
http://roosnaflak.com

On Mon, Nov 4, 2019 at 18:50, Richard Russon <rich at flatcap.org> wrote:

> Hi Kenneth,
>
>> folder-hook . `rm -f /tmp/neomutt-arch/*`
>
> Ah, there are a couple of problems here.
>
> The first is quite subtle. Your command isn't quoted.
> Because of this, the *parser* executes the `backticked` command on startup
> and NeoMutt sees the processed config:
> folder-hook .
>
> There's nothing after the '.' because `rm` didn't print anything.
> Meaning you see:
> Error: Too few arguments on folder-hook
>
> Let's quote the command:
> folder-hook . '`rm -f /tmp/neomutt-arch/*`'
>
> Now, it's not executed when the hook is parsed.
> When NeoMutt opens a folder, it processes the `backticks` first,
> then tries to run the command, which is an empty string.
> : unknown command
>
> So, let's add a NeoMutt 'echo' command to keep it happy:
> folder-hook . 'echo `rm -f /tmp/neomutt-arch/*`'
>
> I hope that makes sense.
>
> Cheers, Rich / FlatCap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.neomutt.org/pipermail/neomutt-users-neomutt.org/attachments/20191104/afc0fdf9/attachment.html>


More information about the neomutt-users mailing list