"Command substitution is when you take the output of
one command and use it as the argument for another command. If you
simply invoke the date utility, you'll get the following output.
Fri Jan 19 17:13:29 EST 2007
"That works here, but it might not work well in other cases,
like when you're writing a bash script. You would then need to
consider using command substitution. There are two ways to do
"The first way is the more modern way, and is really the only
way that you want to use. You surround the command that you want to
substitute with parentheses, and then precede it with a
dollar-sign. Here, we're using echo to show the output of
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.