0

In bash scripting what is the difference between $(command) and `command`. They both return the output of the command.

Let's say echo "There are $(wc -l < /etc/group) lines." and echo "There are `wc -l < /etc/group` lines.

They both print the same result.

guerrier
  • 117
  • 5

1 Answers1

0

They are essentially the same thing, but the backtick method is deprecated I think, and the brackets method is preferred.

Both methods indicate command substitution though.

michjnich
  • 2,137
  • 2
  • 14
  • 26