WHy the double square brackets?

One of the senior administrators gave me a shell script to modify and it begins as follows:

if [[ -s valid_users.tmp ]] && [[ -s invalid_users.tmp ]]
{more code follows}

Why the double square brackets?

This is the 3rd time in 3 days this same question has been asked, how about using the search?

I read what you posted so why doesn't the following work:

if ![[ -s illegal_loggons.tmp ]] && ![[ -s illegal_loggons1.tmp ]] then
exit
fi

I am trying to say if both files have no information in then exit...Should the "!" go inside the square brackets? The interpreter does not seem to recognize ![[

Yes inside.

if [[ ! -s illegal_loggons.tmp  ]] && [[ ! -s illegal_loggons1.tmp  ]]
then
exit
fi

I get this from the interpreter now:

line 26: syntax error near unexpected token `fi'
./script.sh: line 26: `fi'

Something wrong somewhere else in your script it seems.

Actually why are you using -s ? -e should be used.

-e file = True if the file exists.
-s file = True if the file exists and is a socket.

#!/bin/ksh
if [ ! -s valid_users.tmp -a ! -s invalid_users.tmp ]
then
exit
fi

Why are we back to -s?
What is the -a for?

Why is there no &&?

I am a little confused.

Why is there no double bracket?
What is the -a for and why is it not there for second file?

If I sound confused and need an explanation well I am!

Sorry about the double posting. I thought that the first one did not go through....

-e does not work it seems. -s does!

Single brackets.
Please see "man test" for a good explanation about testing file types.
Single square bracket syntax "[ expr ]" is exactly the same as "test expr".
In many shells "test" is actually a shell builtin.
Within "test" the -a is the logical AND operator (as distinct from -o which is the logical OR operator).

Now for double brackets!

There is a formal unix shell syntax involving "[[ expression ]]" which has much overlap with "test". There is a good explanation in "man ksh" . The term between the brackets is a Conditional Expression which is also explained at great length in "man ksh" - including the use of double-ampersand for logical AND "&&", and double pipe for logical OR "||".

Personally I only find use for "[[ expression ]]" in "while" loops. Others may differ.
while [[ expression ]]
do
done