mutt variable expansion in shell command ?

Cameron Simpson cs at cskk.id.au
Thu Aug 29 23:12:29 UTC 2019


On 29Aug2019 19:11, Mathieu Carpentier <mathieu.carpentier at yahoo.com> wrote:
>I did few tests and I think I'm going to use environment variable.
>
>Before calling mutt I will source "~/.mutt/my-env.sh" where I'll set the
>variable I'd like to use in muttrc (eg. MUTT_MAIL_FOLDER=~/Mail).
>mailboxes `echo -n "+ "; cd $MUTT_MAIL_FOLDER/gmail; find . -maxdepth 1
>-type d -name "*" -printf "+'%f' "`

I invoke mutt via an script which sets various environment variables 
(and optionally does other stuff) for the same reason.

>It seems to work fine. I was just looking for a way to do it only with mutt
>variable.

Well, you can push a string which is subject to variable expansion, eg 
(untested):

  :push "blah $mutt_var blah"

and make hooks or macros to do such a thing.

If what you push then runs a shell script...

It is cumbersome, to say the least.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Mutt-users mailing list