nerdexam
LPI

101-400 · Question #302

You have two shell scripts, foo and bar. You wish to have bar execute if foo returns an exit status of 0 Select the correct command:

The correct answer is C. foo && bar. See the full explanation below for the reasoning.

Question

You have two shell scripts, foo and bar. You wish to have bar execute if foo returns an exit status of 0 Select the correct command:

Options

  • Afoo; bar
  • Bfoo || bar
  • Cfoo && bar
  • Dfoo % bar

How the community answered

(62 responses)
  • A
    3% (2)
  • B
    8% (5)
  • C
    74% (46)
  • D
    15% (9)

Community Discussion

No community discussion yet for this question.

Full 101-400 Practice