Which three statements are true about the bash shell script’s capabilities and features?

Which three statements are true about the bash shell script’s capabilities and features?

Which three statements are true about the bash shell script’s capabilities and features?

A.
The s* shell variable holds the exit status of the last command executed in the foreground.

B.
The | | operator ensures that a command is run only if the command preceding the | | operator
fails.

C.
If test “SMYVAR” = prod and if [“SMYVAR” *= prod ] are equivalent ways to test the value of
the MYVAR variable in a shell script.

D.
If the first line of the script begins with #!/bin/sh, then the sh shell program is unable to interpret
the script.

E.
The bash shell supports more than 10 command-line arguments.

F.
The && operator ensures that a command is run regardless of the outcome of the command
that preceded the && operator.

Explanation:



Leave a Reply 4

Your email address will not be published. Required fields are marked *


wolfsrudel

wolfsrudel

B, C, F

Djuro

Djuro

B, C, E

F is wrong, getconf ARG_MAX
262144

D is wrong,sh shell will be able to interpret if it specified #!/bin/bash

Jef Adams

Jef Adams

from man bash

command1 || command2

command2 is executed if and only if command1 returns a non-zero exit
status. The return status of AND and OR lists is the exit status of
the last command executed in the list.
—> B

command1 && command2

command2 is executed if, and only if, command1 returns an exit status
of zero.
—> not F

E check man page

So correct answers are B,C,E