shell调用mysql客户端执行sql后结果去掉第一行

#!/bin/bash
result=`mysql -u matrix  -h m7880.zeus.mysql.ljnode.com -P 7880 -pxxxxxxxxxx -e “select count(*) from project where admin=’yanlingxia001′ and domain=’$line’ and status=0;” matrix_platform | awk ‘NR>1’`
awk ‘NR>1’ NF是指awk正在处理的记录包含几个域(字段),这于域分隔符有关,默认为空

shell调用mysql客户端执行sql后结果去掉第一行

#!/bin/bash
result=`mysql -u matrix  -h m7880.zeus.mysql.ljnode.com -P 7880 -pxxxxxxxxxx -e “select count(*) from project where admin=’yanlingxia001′ and domain=’$line’ and status=0;” matrix_platform | awk ‘NR>1’`
awk ‘NR>1’ NF是指awk正在处理的记录包含几个域(字段),这于域分隔符有关,默认为空

shell调用mysql客户端执行sql后结果去掉第一行

#!/bin/bash
result=`mysql -u matrix  -h m7880.zeus.mysql.ljnode.com -P 7880 -pxxxxxxxxxx -e “select count(*) from project where admin=’yanlingxia001′ and domain=’$line’ and status=0;” matrix_platform | awk ‘NR>1’`
awk ‘NR>1’ NF是指awk正在处理的记录包含几个域(字段),这于域分隔符有关,默认为空