Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Mailpath notification message



Duncan Sargeant wrote:
> I usually overcome this problem by using $HOME in my scripts.  I
> think this is a better way because you can put it in the middle of
> double-quote quoted strings (but not single quotes.)
> 
> export MAILPATH="$HOME/mailspool/rusty:$HOME/Mail/z?Zsh mail."
> 
> IMHO its a good habit to get into.
> 
> better understand parameter expansion??
> 
> echo $HOME "$HOME" '$HOME' ~ "~" '~'
> 
> /home/wheel/dunc /home/wheel/dunc $HOME /home/wheel/dunc ~ ~
> 
> 
> PS: what was the rationale behind quoting tildes?  Not critising
>     it, but this means it isn't a short parameter ... so what is
>     it?

Quoting rules are described quite precisely in POSIX which just documents
the usuall shell behaviour.  Note that in a strict POSIX shell
export MAILPATH=~/mbox:~/Mail/zsh does not expand the tildes but zsh does
similarily to other shells (but bash/ksh/pdksh probably disables this
expansion when POSIXLY_CORRECT is set).  The most portable is
MAILPATH=~/mbox:~/Mail/zsh ; export MAILPATH

About MAILPATH: bash does expand the mailpath component before checking the
file so in bash MAILPATH=~/mbox:~/Mail/zsh" works.  However AT&T ksh, pdksh
and zsh does not do that.

Zoltan



Messages sorted by: Reverse Date, Date, Thread, Author