日常常用shell命令

getBatidSql="select ts_bat_id from ts_bat where gen_date>='2022-03-01' and gen_date<'2022-04-01' and op_mode='J' and city_id='${city_Id}' and state<>'50X'"
batId=`/data/dubbo/sh/mysql/acct_select.sh ${area} sql "${getBatidSql}"|awk -F ' ' '{a=a$1","}END{print a}'|sed 's/.$//'`
if [ "${batId}" = "" ];then
batId=0
fi

对于取得的数据,转化为一串字符串。

 

area=`cat /home/telepay/dengg/1haohuakou/cityRegion.txt|awk '$3=="'$city_id'"{print $4}'`

取得指定值

posted on 2022-03-11 16:31  hello_dg  阅读(41)  评论(0)    收藏  举报