什么' c'在args和grep这样的Bash命令中意味着什么?

时间:2017-12-04 09:20:23

标签: bash grep xargs

echo "^[$*]*[$5][$*]*$" |xargs -I c grep -i c words| grep -i ".....*"| grep -
iv "...........*"| sort -f >list

有人能告诉我{x}和grep之后c的含义吗?

重要提示:words是一个包含文字

的文件

1 个答案:

答案 0 :(得分:0)

来自xargs的{​​{3}}:

  

-I replace-str

     

将initial-arguments中出现的replace-str替换为从标准输入读取的名称。此外,不带引号的空格不会终止输入项;相反,分隔符是换行符。隐含-x-L1

所以xargs -I c grep -i c words会将c-I的参数)替换为从标准输入中读取的内容,在这种情况下^[< positional_args_here> { {1}}< 5th_positional_arg_here> ]*[< positional_args_here> ][。 (shell将分别用位置参数和第五个位置参数替换引用字符串中的]*$$*。)