MYSQL_BIN="/usrl/local/mysql/bin/mysql"
SQL_FILE="/root/sql/shop_sql"
getids = `$MYSQL_BIN -u root -pming < $SQL_FILE -N | awk "BEGIN{sign=',';ids=''}{ids=$1''sign''ids}END{print $ids'0'}"
update_sql="update shop.sys_cache set cache_value='$getids'" where cache_key='prodsale';"
ehco $update_sql | $MYSQL_BIN -u root -pming -e
if [$? -eq 0 ]
then
echo 'ok'
else
echo 'not ok'
fi
SQL_FILE="/root/sql/shop_sql"
getids = `$MYSQL_BIN -u root -pming < $SQL_FILE -N | awk "BEGIN{sign=',';ids=''}{ids=$1''sign''ids}END{print $ids'0'}"
update_sql="update shop.sys_cache set cache_value='$getids'" where cache_key='prodsale';"
ehco $update_sql | $MYSQL_BIN -u root -pming -e
if [$? -eq 0 ]
then
echo 'ok'
else
echo 'not ok'
fi