<<< Date Index >>>     <<< Thread Index >>>

Re: Conditionally include a file in the configuration



* romildo@xxxxxxxxxxx <romildo@xxxxxxxxxxx> [040224 10:40]:
> Is it possible to conditionally include a file
> in the configuration file?

To more directly do what you are asking to do (but see the other replies
for more mutt-like ways which may accomplish what you want) something
like the following may work

in .muttrc:

source "/path/to/my/conditional/script.sh|"

in /path/to/my/conditional/script.sh (bash script)

>>>START 

#!/bin/bash

if [ $environmentvariable == value ] 
then
        cat << ENDOFMUTTRC
        
        # insert muttrc commands for if $environmentvariable = value

ENDOFMUTTRC

else
        cat << ENDOFMUTTRC
         
        # insert muttrc commands for if $environmentvariable not value

ENDOFMUTTRC

fi

>>>END

cheers,
jack