store result of command in variable bash

Shell
variable=$(command [option…] argument1 arguments2 …)
Source

Also in Shell: