Log inBook a Demo
DebugJuniorDevOpsAuto-graded

Fix a buggy bash script until tests pass

A fifteen-minute floor check on basic command-line scripting, used to screen candidates before longer exercises.There is a broken shell script in your workspace. Given a text file it should count word occurrences and print the ten most frequent — run it and you will see immediately that it does not. Read it, work out what it is doing wrong, and fix it until it produces the right output.
15 min
bash

You're done when

  • The script runs without erroring on the sample input.
  • It counts word occurrences across the whole file.
  • It prints the ten most frequent words, most frequent first.
  • The output format matches what the brief specifies.
  • It still works on a different input file, not just the sample.

What it measures

Shell scriptingReading a pipeline of shell tools and understanding what each stage does to the data passing through it.
Debugging and profilingIsolating which stage of a pipeline is responsible for wrong output rather than rewriting the whole script.
Working with AI on unfamiliar codeUsing Claude to explain shell you did not write, then verifying the explanation against actual behaviour.

Your environment

Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards

Start this lab

15 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo