Re: nother bash question
On Monday 13 June 2016 04:19:46 Thomas Schmitt wrote:
> Hi,
>
> Gene Heskett wrote:
> > if test ${InMail} = "gene"
> > bin/mailwatcher: line 66: test: =: unary operator expected
>
> The syntax problem is most probably about missing "-quotes around
> the variable ecaluation ${InMail} which would have to be empty to
> cause the message:
>
> $ test $notdefined = "hello world"
> -bash: test: =: unary operator expected
> $ test "$notdefined" = "hello world"
>
> $ defined=x
> $ test $defined = "hello world"
> $
>
> Another negative syntax effect would happen if ${InMail} did consist
> of more than one word:
The likelyhood of that is .0000000slim to none, my procmail would have to
have developed a tummy ache, and I'd have lots bigger problems.
>
> $ multiword="x y"
> $ test $multiword = "hello world"
> -bash: test: too many arguments
>
> (On the other hand, "gene" does not need its quotes because the
> text is a single constant word. "hello world" needs them, because
> of the blank on the middel.)
Ahh, I see.
> -------------------------------------------------------------------
>
> Is ${InMail} supposed to be empty ?
> If not, then the script has another problem about properly setting
> the variable.
>
That is set by inotifywait's return of the name of the file that procmail
just closed. It may not be a match with my tests as there a virii file
there too. But clamd isn't catching but maybe 10% of that.
I should probably clear InName to "", but inotifywait has been coping
with that for about a decade :)
> Have a nice day :)
It's better so far, but its also way to early, so back for some more
zz's. Thank you.
>
> Thomas
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
Reply to: