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:

PrepAway - Latest Free Exam Questions & Answers

A.
foo; bar

B.
foo || bar

C.
foo && bar

D.
foo % bar

Explanation:
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


Leave a Reply