Linux Administration
medium

Pregunta de Linux Administration #019e3987

Enunciado de la Pregunta
Linux Administration
#command substitution
#variable assignment
#date command
#shell expansion
Medio

Which of the following commands puts the output of the command date into the shell variable mydate?

A

mydate="$(date)"

Correcto
B

mydate="exec date"

C

mydate="$((date))"

D

mydate="date"

E

mydate="${date}"

Explicación Oficial / Explicaciones de la Comunidad

Command substitution using $(...) is the standard and recommended way to capture the output of a command into a variable.