Command Substitution
Command substitution allows the output of a command to replace the command name. There are two forms:
$(command)
or
`command`
Bash performs the expansion by executing command and replacing the command substitution with the stan-
dard output of the command, with any trailing newlines deleted. Embedded newlines are not deleted, but
they may be removed during word splitting. The command substitution $(cat file) can be replaced by the
equivalent but faster $(< file).
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |