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



A.

mydate="$(date)"

B.

mydate="exec date"

C.

mydate="$((date))"

D.

mydate="date"

E.

mydate="${date}"

題解

使用「$(指令)」這樣的方式可以取得指令的輸出結果。所以答案是選項A。