Two or more test expressions may be combined, using the -o (or) and/or the -a (and) attributes:
#!/bin/sh
if test $# -eq 0
then
echo Must provide parameters.
exit 1
fi
if test $# -gt 2 -a $# -lt 5
then
echo There are 3 or 4 parameters.
fi
if test $# -ge 1 -a $# -lt 3
then
echo There are 1 or 2 parameters.
fi
exit 0
Note that -a has precedence over -o.