Re: [Exim] Mailing lists

Top Page
Delete this message
Reply to this message
Author: Phil Pennock
Date:  
To: davidturetsky
CC: exim-users
Subject: Re: [Exim] Mailing lists
On 2000-08-22 at 03:22 -0700, davidturetsky gifted us with:
> RCPT TO: cat /etc/exim/lists/free
> 501 missing or malformed local part (expected word or "<")


> for x in 'cat /etc/exim/lists/free'; do


Those should be back-ticks, top-left to bottom-right: `...`

The rest of this is off-topic for the Exim list; just including the list
on the CC so that they can see what I've said.

If you want to make it clearer, try the (POSIX standard) syntax
instead, which is $(...)

Basically, this is command-substitution - run the bit between the
backticks as a separate command and supply the output as parameters in
place of this.

With:
for x in $(cat /etc/exim/lists/free); do
echo ". $x ."
done
then for each white-space-separated word in /etc/exim/lists/free, the
shell would echo ". the-word ." as a line on it's own.

Eg,
$ cat F
alpha bravo
charle
delta
$ for x in $(cat F); do echo ". $x ." ; done
. alpha .
. bravo .
. charle .
. delta .
$

The command-line is effectively:
for x in alpha bravo charlie delta ; do echo ". $x ." ; done
which is what you have - the bit of the original command-line containing
the $(..) (or `..`) is substituted by the results of running that nested
command.

For more information, try "man sh", and do a websearch for a guide to
Unix shells. I recommend Google <http://www.google.com/>
--
"We've got a patent on the conquering of a country through the use of force.
We believe in world peace through extortionate license fees." -Bluemeat