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

Can anyone tell me what the c means after xarg and grep?

important note: words is a document containing words

  • 4
    did you read the [manpage](http://man7.org/linux/man-pages/man1/xargs.1.html) ? – ymonad Dec 04 '17 at 09:24
  • In this case it contains the string `^[$*]*[$5][$*]*$`. Read the manpage and search for `-I`, the replace-str option. – arco444 Dec 04 '17 at 09:27
  • This has nothing do with the manual. How can I possible research/know what 'c' means if it has no meaning bound to a command? I'm asking what c does on its own. I can google the meaning of a '|' pipe, but no way in the world 'c' – Rob Van Meirvenne Dec 05 '17 at 12:15

1 Answers1

0

From the manual page for xargs:

-I replace-str

Replace occurrences of replace-str in the initial-arguments with names read from standard input. Also, unquoted blanks do not terminate input items; instead the separator is the newline character. Implies -x and -L1.

So xargs -I c grep -i c words will replace c (the argument of -I) with what's read from standard input, in this case ^[<positional_args_here>]*[<5th_positional_arg_here>][<positional_args_here>]*$. (The shell will replace $* and $5 in the quoted string with the positional arguments and the 5th positional argument respectively.)

Community
  • 1
  • 1
AlexP
  • 4,370
  • 15
  • 15