π§© Repair the corrupted script
These script fragments contain bugs. Read the explanation, repair the code in the editor, and let the safe text comparison tool compare your solution with the reference answer.
Important: this is not a Bash interpreter or a real execution environment. The checker compares your text with a reference solution, ignoring blank lines, indentation, and whitespace at the ends of lines. Another technically valid solution may therefore be rejected. All example test results are educational illustrations, not results from actual code execution.
π§ͺ EXPECTED BEHAVIOR (SIMULATED)
All characters are allowed, including $, `, |, ;, &, quotation marks, < and >. No code is executed.
Reference solution
This is one possible correction, not a complete formal verification of the script.
π¬ Safety scanner (educational)
This scanner flags a limited set of potentially
risky patterns in the text you enter,
including eval,
curl | bash,
and potentially destructive file deletion commands.
It does not execute any code and is
not
a comprehensive security analysis.
π Bash debugging checklist
β Quote variable expansions when you intend
to pass a single argument:
"$name".
β Use
printf '%s\n' "$value"
for predictable text output.
β Compare numbers using
(( ))
or numeric operators such as
-gt,
rather than lexicographical comparisons
with >.
β Use
IFS= read -r
to read lines without interpreting
backslashes or trimming surrounding whitespace.
β Use
bash -n
to check Bash syntax and ShellCheck
for static analysis suggestions.
Neither tool can guarantee that a script is safe.
β Test real scripts only in an isolated training environment using fictional data.
π Privacy by design
No accounts, no external libraries, no analytics, no storage of entered code, and no network requests initiated by this page. Your progress exists only in the current browser tab and disappears when you reload the page. The example data contains no real private IP addresses, MAC addresses, hosting details, or secrets.
The Content-Security-Policy
restricts the page to same-origin CSS and JavaScript
and blocks connections initiated through
browser networking APIs.
Server-side security headers and other website files
must be reviewed separately.