Files
curriculum/1.solar-system/1.welcome/09.the-scripter/index.md

998 B

type, title, xp, duration, difficulty
type title xp duration difficulty
challenge The Scripter 100 35 3

The Scripter

[INCOMING — Mission Control, Earth]

Cadet, time to combine commands. Bash lets you embed the output of one command inside another using $(...)command substitution:

echo "Today is $(date '+%Y-%m-%d')"
# → Today is 2026-05-04

When your script runs, a directory supplies/ exists with several files. Produce report.txt containing exactly two lines:

Date: <today in YYYY-MM-DD format>
Files in supplies: <count of entries in supplies/>

Two helpers:

  • date '+%Y-%m-%d' — today in the right format
  • ls supplies | wc -l | tr -d ' ' — entry count, whitespace stripped

[END TRANSMISSION]

Your Task

In starter/starter.sh, use echo + $(...) substitution to produce the two-line report.

Objectives

  • report.txt exists
  • Line 1 matches Date: <today>
  • Line 2 matches Files in supplies: <count>