SadServers
  • Scenarios
  • Labs
    All Labs Linux & Bash Web Servers Databases Data Processing Docker Kubernetes CI/CD Infrastructure As Code Observability Tooling / Applications
  • Dashboard
  • Solutions
    For Individuals For Businesses
  • Ranking
  • Newsletter
  • FAQ
  • Documentation
    Support Pro Accounts Pro+ Accounts Business Accounts Gift API CLI/TUI Privacy Troubleshooting Interviews
  • Blog
  • Pricing
  • Gift
    Gift Purchase Gift Redeem
  • About
Log In - Sign Up

"Bournemouth": Same job, three shells

Scenario: "Bournemouth": Same job, three shells

Level: Medium

Type: Do

Tags: bash  

Access: Email

Description: This box is a small shell lab. Debian's /bin/sh is dash, your login shell is bash, and zsh is installed. Cron, Docker CMD lines, and most #!/bin/sh scripts do not run bash — and zsh script.sh does not honour a POSIX shebang.

Read /home/admin/lab/00-START-HERE.txt and run the demos with:
/home/admin/lab/compare.sh /home/admin/lab/demos/01-identity.sh
(there are ten snippets under demos/; run-all.sh runs every one).

Then write a script /home/admin/fleet-report.sh that prints a host status table from /home/admin/lab/inventory/ (hosts, disk.tsv, access.log).

Rules:
- One header line exactly: HOST DISK ERR STATUS
- Then one line per host from hosts, in that file's order: NAME DISK ERR STATUS (single spaces, no tabs)
- DISK is the integer from disk.tsv
- ERR is how many access.log lines have that host and code 500
- STATUS is crit if DISK >= 90 or ERR >= 5; else warn if DISK >= 80 or ERR >= 1; else ok

The same file must print that table with no extra lines when run as: sh /home/admin/fleet-report.sh, bash /home/admin/fleet-report.sh, and zsh /home/admin/fleet-report.sh.

demos/10-broken-report.sh is a bash sketch that is not a valid solution.

Root (sudo) Access: True

Test: /home/admin/fleet-report.sh exists. sh, bash, and zsh each print the same report for the inventory files, matching the rules above.

The "Check My Solution" button runs the script /home/admin/agent/check.sh, which you can see and execute.

Time to Solve: 20 minutes.

Send Us Feedback
Get Notified
For announcements like new scenarios. We'll never share your email with anyone else.
SadServersSadServers

Real-world Linux and DevOps scenarios for hands-on learning and technical assessment.

Uptime Robot ratio (30 days)
Product
  • Scenarios
  • For Individuals
  • For Businesses
  • Pricing
Resources
  • FAQ
  • Blog
  • Newsletter
Company
  • About Us
  • Support
  • Privacy Policy
  • Terms of Service
  • Contact
Connect With Us
info@sadservers.com

Made in Canada 🇨🇦
Updated: 2026-11-01 18:17 UTC – 42ba89a