You are not logged in.

#1 2008-09-04 04:38:37

Berticus
Member
Registered: 2008-06-11
Posts: 731

Have mutt execute external command

How can I get mutt to execute::

echo > /home/berticus/.mail

anytime I run mutt?

Offline

#2 2008-09-04 06:59:33

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: Have mutt execute external command

Put it in a script that runs mutt afterward?
Or am I totally missing the point?


neutral

Offline

#3 2008-09-04 07:09:24

drag0nl0rd
Package Maintainer (PM)
From: Czech Republic
Registered: 2007-10-24
Posts: 127
Website

Re: Have mutt execute external command

What about making an alias in your .bash_aliases? Something like

 alias mutt='echo > /home/berticus/.mail && mutt'

Offline

#4 2008-09-04 08:22:47

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: Have mutt execute external command

The proposals offered above are completely valid. They make your shell wrap the mutt call inside other code, which does what you want.

From the wording of your request, I suspect that you're looking for a way to do this internally to mutt, though. There may be good reasons to do that; e.g., you may want to have your echo performed only when mutt's internal state becomes a certain way (e.g., only when you visit a given folder). To do it mutt-internally, you can use mutt's backquoting feature.
That is, instead of:

set my_temp_variable="setting"

you could use:

set my_temp_variable=`echo > where_i_want_it`

Or instead of:

source file

you could use:

source `do_my_shell_commands_without_writing_to_stdout; echo /dev/null`

hth

Offline

#5 2008-09-04 14:47:43

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: Have mutt execute external command

Profjim wrote:

The proposals offered above are completely valid. They make your shell wrap the mutt call inside other code, which does what you want.

From the wording of your request, I suspect that you're looking for a way to do this internally to mutt, though. There may be good reasons to do that; e.g., you may want to have your echo performed only when mutt's internal state becomes a certain way (e.g., only when you visit a given folder). To do it mutt-internally, you can use mutt's backquoting feature.
That is, instead of:

set my_temp_variable="setting"

you could use:

set my_temp_variable=`echo > where_i_want_it`

Or instead of:

source file

you could use:

source `do_my_shell_commands_without_writing_to_stdout; echo /dev/null`

hth

Thanks, I'll try this out.

Offline

Board footer

Powered by FluxBB