nerdexam
CompTIA

PT0-001 · Question #97

A penetration tester is checking a script to determine why some basic persisting. The expected result was the program outputting "True." Given the output from the console above, which of the…

The correct answer is B. Remove the 'let' in front of 'dest=5+5'. C. Change the '=" to '-eq'. Given this scenario, the word let does not need to be included in the script, so it can be removed, and in Bash, the equivalent to an = is -eq, which is the arithmetic binary operator. Once these modifications are made, the script will work as expected.

Vulnerability discovery and analysis

Question

A penetration tester is checking a script to determine why some basic persisting. The expected result was the program outputting "True." Given the output from the console above, which of the following explains how to correct the errors in the script? (Select TWO)

Exhibit

PT0-001 question #97 exhibit

Options

  • AChange fi' to 'Endlf
  • BRemove the 'let' in front of 'dest=5+5'.
  • CChange the '=" to '-eq'.
  • DChange -source* and 'dest' to "Ssource" and "Sdest"
  • EChange 'else' to 'elif.

How the community answered

(40 responses)
  • A
    8% (3)
  • B
    73% (29)
  • D
    5% (2)
  • E
    15% (6)

Explanation

Given this scenario, the word let does not need to be included in the script, so it can be removed, and in Bash, the equivalent to an = is -eq, which is the arithmetic binary operator. Once these modifications are made, the script will work as expected.

Topics

#bash scripting#script debugging#syntax errors#automation tools

Community Discussion

No community discussion yet for this question.

Full PT0-001 Practice