永发信息网

awk 判断文件是否存在

答案:2  悬赏:40  手机版
解决时间 2021-02-22 16:07
  • 提问者网友:我一贱你就笑
  • 2021-02-22 09:15
awk 判断文件是否存在
最佳答案
  • 五星知识达人网友:痴妹与他
  • 2021-02-22 10:28
awk 'BEGIN{a=system("test -f /etc/passwdd");if(a) {print "file is exist."}}'
全部回答
  • 1楼网友:詩光轨車
  • 2021-02-22 10:44
try:#! /usr/bin/awk -f { if( nr % 3 == 1 ) { if ( s ) print "select * from t_user_actionlog t where t.visitdate >= to_date('2011-11-01','yyyy-mm-dd') and t.msisdn in (\n'" s "')" > "a"n".txt" n ++ s = "" } s = s ? s "',\n'" $0 : $0 } end { print "select * from t_user_actionlog t where t.visitdate >= to_date('2011-11-01','yyyy-mm-dd') and t vc钩子hook .msisdn in (\n'" s "')" > "a"n".txt" } 最后一行,放到end里面做 比如 awk 'end{print}' 就是打印最后一行
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯