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

Re: How to save to a default mail directory?



Re: Theo Vermeulen in <20040406101011.GA18173@xxxxxxxxx>

Some minor comments:

> alias mutt='~/runmuttinappropiatedir'

I'd put the sh script in ~/bin, but that's a matter of taste. (If you
do, you have to call /path/to/real/mutt explicitely there to not create
a loop - my Mutt wrapper is therefore simply called "m".)

> [runmuttinappropiatedir]
> #bin/sh

Rather "#!/bin/sh", but it will work in most cases because the kernel
will hand everything it doesn't understand to /bin/sh anyway.

> cd ~/Maildir  # got to right directory
> mutt          # run mutt 
> cd -          # return to previous directory

"cd -" doesn't do anything here because "cd" inside a sh script doesn't
affect any settings of the calling process/shell. You don't have to
restore the directory. (Strictly speaking, "cd -" is even a bashism.)

Your script hides all parameters given to the mutt alias; this breaks
"mutt address", "mutt -f folder" etc. Use

        mutt "$@"

instead in the script.

Christoph
-- 
cb@xxxxxxxx | http://www.df7cb.de/

Attachment: signature.asc
Description: Digital signature