Autor: Matt Data: A: exim Assumpte: Re: [exim] resending messages
Matt wrote:
> Steffen Heil wrote:
>
> > Hi
> >
> > Sorry, I am not good at linux scripting, but if I use
> >
> > > for file in ls; do formail -s sendmail some@??? < $file;
> > > done
> >
> > I get:
> >
> > -bash: ls: No such file or directory
> >
> > and if I replace "ls;" with "*", i get:
> >
> > -bash: syntax error near unexpected token `<'
> >
>
> Personally, I like little shell scripts for stuff like this.
>
> #!/bin/sh
> #
> email=$(ls $*)
> #
> {
> for x in ${email};
> do
> sendmail some@??? < ${x};
> done
> }
>
>
> Running is as simple as: /path/to/script /dir/to/list
>
Slight addendum :) That should be:
email=$(find $*)
If you are outside the directory, find will supply the full path to
sendmail.