What is difference b/w these two command and output variable:
output=($(command))
And
output=`command`
In the first case, the resulting variable is an array, with the number of elements depending on the output of your command. In the second case, it is a scalar containing the complete result value. This difference is only due to the extra outer brackets in the first case.
Try it with, for example, the ls command to see the difference.
Additionally, the $(command) form has superseded the 'command' form for command substitution.