Separate the square bracket and the "$Mac" with a space character. That is:
if [ "$Mac" -ne "00:00:00:00:00:00" ]; then
~ed.
On 12/19/06, Don Gould <[EMAIL PROTECTED]> wrote:
I get...
00:e0:4c:a2:7e:66
./CheckDLimit.sh: line 22: [00:e0:4c:a2:7e:66: command not found
From...
#!/bin/sh
source oncs.conf.sh # Include file with all paths and parameters
QrySQL="SELECT oncs.tblSessionRequest.MACAddress ";
QrySQL="$QrySQL FROM oncs.tblSessionRequest ";
QrySQL="$QrySQL GROUP BY oncs.tblSessionRequest.MACAddress;";
#echo $QrySQL;
MacList=`echo "$QrySQL" | $MYSQL_BIN -h $ONCS_DATABASE_HOST -u
$ONCS_DATABASE_USER -p$ONCS_DATABASE_PASSWORD -s`;
# echo $MacList;
for Mac in $MacList; do
echo $Mac;
#Now get all the IP's for this mac...
if ["$Mac" -ne "00:00:00:00:00:00"]; then *<<<<<==== LINE 22*
# && [$Mac != "00:00:00:00:00:00"] then
echo "process this mac: $Mac";
# Blank or 0 Mac Test
fi
done
I've been googling for 30 mins now and can't figure it out.
--
Don Gould
www.thinkdesignprint.co.nz - www.tcn.bowenvale.co.nz -
www.bowenvale.co.nz - www.hearingbooks.co.nz - www.buxtonsquare.co.nz -
skype:ThinkDesignPrint?add - Good ideas: www.solarking.co.nz