PrepAway - Latest Free Exam Questions & Answers

You wish to have bar execute if foo returns an exit status of 0 Select the correct command?

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:

A.
foo; bar

B.
foo || bar

C.
foo && bar

D.
foo % bar

Explanation/Reference:
A) executes foo and bar regardless of exit codes
B) executes bar only if foo fails
D) % is used in trimming text in the shell

One Comment on “You wish to have bar execute if foo returns an exit status of 0 Select the correct command?


Leave a Reply