awk函数中如何执行shell中的函数
已awk中执行wget函数为例
当需要动态读取文本中的数据(多域),每个域中的数据作为wget访问的参
#!/bin/bash
today=$(date--date="1dayago"+%Y%m%d)
host="192.168.105.100";
mysql-h192.168.105.100-uroot--password=rootclub-e"setnamesgbk;selectid,count(1)frompostwheredate(time)='$today'andfloor='0'groupbyid">/usr/post.log
awk-F'\t'-vh=$host'{
if($1!="barid"){
httpUrl="http://"h":8080/admin/login.do?topics="$2"&id="$1;
#printhttpUrl;
wgethttpUrl="wget\""httpUrl"\"-q-O/usr/wgetlog.log";
#printwgethttpUrl;
system(wgethttpUrl);
}
}'/usr/post.log
system在awk中可以执行shell中的函数,但是system中只能是字符串,system中不能识别awk中,或awk外部的变量。
相关推荐
chenpro 2020-07-04
fendou00sd 2020-06-16
RealJianyuan 2020-06-14
cwgxiaoguizi 2020-06-05
chenpro 2020-06-02
Neptune 2020-05-31
老谢的自留地 2020-05-09
YukiRain 2020-05-08
baobaozai 2020-04-29
Proudoffaith 2020-04-08
fenxinzi 2020-03-01
zhiliang 2020-01-31
wannagonna 2020-01-13
wandererdl 2019-12-25
chenchuang 2020-01-25
jyj00 2020-01-09
fendou00sd 2020-01-07
fendou00sd 2020-01-06
PHP学习笔记 2020-01-06