3

I came across this picture (below), obviously it is a pun or some kind of allusion incorporating command-line expressions. Frankly speaking I do not understand anything of it except for grep -n. However, I searched for the string "**/*" via google and I did not even get one hit.

      image with **/* example command

1 Answers1

2

To round out the comments into an Answer,

  • grep -n will search for the given expression in the given files or standard input, reporting the line number that matches were found on.
  • \"in$Ps\" is the expression that grep is looking for. Since the double-quotes are quoted, they are part of the text that grep will search for. The $Ps part is a little unclear to me, since the shell will try to interpret Ps as a variable name.

    If $Ps is not set, then grep will search for the text: "in".

    If $Ps is set, then the shell will replace that part of the expression with the value of $Ps; for example, if Ps=42, then grep's expression will be: "in42".

    If $Ps is a value that contains whitespace, this will be split into words (as the expansion is unquoted) and it would break the command. The resulting string would also undergo filename globbing if any wildcard characters (such as *) is present in $Ps.

    My best guess is that it's a reference to using PowerShell in VBScript.

  • As Stéphane said, the ** is an extended globbing syntax, which here is used twice, in order to pull up all of the files ending in .asp and .js from within the current directory as well as from subdirectories (recursively) as ones for grep to search through. It is used by the shell, not by grep.

Long story short, the code will display file names and corresponding line numbers for lines that match \"in\", where in is followed by whatever value $Ps holds.

Kusalananda
  • 333,661
Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255