Menu
Coddy logo textTech

System Health Checker

Part of the Fundamentals section of Coddy's Terminal journey — lesson 82 of 82.

challenge icon

Challenge

Easy

Create a shell script called health.sh that displays a system health report with the following sections:

  1. Start with the shebang line (#!/bin/bash)
  2. Print === System Health Report ===
  3. Print User: followed by the output of id -u
  4. Print Current Directory: followed by the output of pwd
  5. Print Running Processes: followed by the count of lines in processes.txt (simulating process count)
  6. Print === End of Report ===

Use command substitution $(command) to capture command output within your echo statements.

Make the script executable and run it. Your output should be:

=== System Health Report ===
User: root
Current Directory: /home
Running Processes: 10
=== End of Report ===

Try it yourself

Terminal

All lessons in Fundamentals