On 29 June 1998, Walter Torres <walter(_at_)tscinternet(_dot_)com> wrote:
Can anyone tell me the difference between these two lines?
MAILDIR=$HOME/mail/
and
MAILDIR=${MAILDIR:-$HOME}
Both of these were found on .procmailrc files in 2 different accounts.
"What's the difference between a hammer and a screwdriver? Both
of these were found in two different tool boxes". (Sorry, I couldn't
resist).
Well, let's see: the first sets $MAILDIR to point to the mail/
directory in your $HOME; the second looks at $MAILDIR, and if it's not
set (or if it's set to an empty value) it sets it to $HOME, otherwise
it leaves it alone. Try "man sh" to find out more about ${...}
substitutions.
Regards,
Liviu
--
Dr. Liviu Daia e-mail: daia(_at_)stoilow(_dot_)imar(_dot_)ro
Institute of Mathematics web page: http://www.imar.ro/~daia
of the Romanian Academy PGP key: finger
daia(_at_)stoilow(_dot_)imar(_dot_)ro