Shells typically implement command substitution by creating a child process to run the first command with its standard outputpiped back to the shell, which reads that output, parsing it into words separated by whitespace. Because the shell can't know it has all the output from the child until the pipe closes or the child dies, it waits until then before it starts another child process to run the second command. This C shell example shows how one might search for all the C files containing the stringmalloc using fgrep and then edit any that are found using the vi editor. The syntactical notation shown here, ` ... `, using backquotes as delimiters, is the original style and is supported by all the common Unix shells.
Objections have been raised to both the syntax, how it's typed, and the semantics, how it works. While easy to type, an important factor for an interactive command processor, the syntax has been criticized as awkward to nest, putting one command substitution inside another, because both the left and the right delimiters are the same. The Korn shell solved this with an alternative notation, $, borrowing from the notational style used for variable substitution. Today, most UNIX shells support this syntax. Microsoft's PowerShell also uses this notation, with the same semantics.
The semantics, breaking the output into words at whitespace, has also been criticized. It worked well on early Unix systems where filenames never contained spaces but it doesn't work at all well on modern Windows and Linux systems where filenames certainly can contain spaces. In either of these previous examples, if any of the filenames matched by the *.cwildcard contains a space, that filename will be broken into two separate arguments to vi, clearly not what was intended. Hamilton C shell solved this with a double backquote notation, `` ... ``, that parses into words only at line breaks. This is an example of command substitution using the operator in PowerShell:
Expression substitution
A related facility, expression substitution, is found in the languages Common Lisp and Scheme, invoked by using the comma-at operator in an expression marked with the backquote operator, and in ABC, by using an expression enclosed between backquotes inside a text display. For example, the ABC command produces the output.