Files
curriculum/1.solar-system/1.welcome/06.the-reader/index.md

40 lines
910 B
Markdown

---
type: challenge
title: "The Reader"
xp: 50
duration: 30
difficulty: 2
---
# The Reader
> **[INCOMING — Mission Control, Earth]**
>
> Cadet, an old mission log was recovered. We need three things from it.
>
> When your script runs, `mission-log.txt` is sitting in the working
> directory. Pull these out:
>
> 1. The first 5 lines → save to `first-five.txt`
> 2. The last 3 lines → save to `last-three.txt`
> 3. The total line count → save to `line-count.txt`
>
> Three commands:
>
> - `head -n N file` — first N lines
> - `tail -n N file` — last N lines
> - `wc -l file` — count lines
>
> [END TRANSMISSION]
## Your Task
In `starter/starter.sh`, produce the three output files using `head`,
`tail`, `wc`, and redirect.
## Objectives
- `first-five.txt` matches the first 5 lines of the log
- `last-three.txt` matches the last 3 lines of the log
- `line-count.txt` contains the line count