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

Re: On executing commands with mutt -e



Long long ago on 22:56 13 Mar 2003, M. Fioretti <m.fioretti@xxxxxxxxx> wrote:
| On Sun, Jan 26, 2003 13:10:29 at 01:10:29PM +1100, Cameron Simpson 
(cs@xxxxxxxxxx) wrote:
| (answering to the question: how to copy with mutt, from
|  within a shell script, all message from an
| mbox file to a maildir/mh mailbox)
| > I'd do something like
| > 
| >     foreach mboxfile (find $HOME/MAIL -type f)
| >        mhdir=$mboxfile-mh   ## pick your own convention
| >        mhdir $mhdir
| >        mutt -F rcfile -f $mboxfile -e <command>
| > 
| > I expect the command to be something like
| > "T.<enter><tag-copy-message>$mhdir<enter><quit>": tag everything, copy
| > it all to the new folder. Note: _untested_!!
| 
| I am having an hard time with this part. Trying it all, or just the
| first part, on the command line, like:
| 
| mutt -F /home/marco/muttrcmaildir -f .MAIL/pending_sw -R -m Maildir -e
| "T."
| 
| I just get: 
| Error in command line: T.: unknown command
| Press any key to continue...

It turns out you can only run configuration commands with -e.
Frustrating.
Fortunately the "push" command is one such.
So try a variation on this:

        mutt -F rcfile -f $mboxfile -e "push 
T.<enter><tag-copy-message>$mhdir<enter><quit>"

Still untested, but this:

        mutt -f +attn -e "push Tfoo<enter>"

worked fine.

Sorry for the long delay. Just tripped across the message now (in a web
search, yet! but I had a copy in my mutt folder) - must have missed it
when posted.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

I wouldn't ride a Honda to Richard Nixon's funeral.
        - Hunter Thompson, _Fear and Loathing in the Near Room_, 1977