Reconnaissance and Enumeration
A Bash script keeps a counter in the variable count and must add 1 to it each time an open port is found. Which line does this?
Show the answer
Correct answerA. count=$((count + 1))
AWhy this is right: $(( )) evaluates integer arithmetic, so the new numeric value is assigned back to count.
BWhy not this: Without arithmetic expansion, Bash stores the literal text 'count+1' instead of a number.
CWhy not this: $count++ expands the variable first and then tries to run its value as a command.
DWhy not this: $( ) is command substitution, so Bash tries to run a command named count and fails.
Arithmetic expansion with $(( )) evaluates the expression as integer math and assigns the result. Plain count=count+1 only stores the literal text 'count+1', because Bash treats it as a string.