nerdexam
LPI

102-400 · Question #82

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

The correct answer is A. mydate="$(date)". See the full explanation below for the reasoning.

Question

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

Options

  • Amydate="$(date)"
  • Bmydate="exec date"
  • Cmydate="$((date))"
  • Dmydate="date"
  • Emydate="${date}"

How the community answered

(43 responses)
  • A
    79% (34)
  • B
    7% (3)
  • C
    2% (1)
  • D
    9% (4)
  • E
    2% (1)

Community Discussion

No community discussion yet for this question.

Full 102-400 Practice