使用xargs循环查找文件中的字符串并打印出来

xiaoxiao2021-02-28  101

sed -n "539,1469p" cate_data_all |awk -F "\t" '{print $2}' |xargs -I {} grep ',,{}' item_id.thread.all

一直不知道xargs的{}能不能在别的shell命令中双引号里起作用,这次试了一下,跟我用Python执行的结果是一样的,看来是可以的

【步骤五】sed -n "开始行,结束行p" 文件名

sed -n "开始行,结束行p" 文件名,表示查看文件的开始行到结束行的内容,sed -n "5,9p" SpecialVariable.sh,如下图

转载请注明原文地址: https://www.6miu.com/read-24197.html

最新回复(0)