6.7. Command SubstitutionIn addition to the older method of command substitutionsurrounding the command with grave accentsBash allows you to perform command substitution using the syntax in Figure 6-23.
Note that the $ that immediately precedes the open parentheses is part of the syntax, and is not a prompt. Here's an example: $ echo there are $(who | wc -l) users on the system there are 6 users on the system $ _ To substitute the contents of a file into a shell command, you may use $(<file) as a faster form of $(cat file). |