标签: unix awk
我想使用Unix AWK命令查找字符串中是否包含子字符串。
例如,伪代码:
a= commandline b=line if(b is contained in a) print "success "
答案 0 :(得分:2)
$ awk 'BEGIN{a="commandline";b="line";if (a ~ b){print "success"}}' success