You already wrote a program. Today it grows up.

Session 1 ended with a file that runs: a shebang, one variable, chmod +x, and ./logsum.sh. Today that file learns to take an argument, refuse bad input and report a number — and then it learns to have a history.

On Windows you must be in WSL Ubuntu or Git Bash. Never PowerShell, never CMD.

You do

Rebuild it. Safe to run twice; it creates everything it needs.

mkdir -p /tmp/lab && cd /tmp/lab
# Ignore the [ and the 2>/dev/null for now — they are minutes 10 and 36.
[ -s app.log ] || curl -fsS -o app.log http://localhost:8899/files/app-2026-08-01.log \
  || cp /Volumes/DATAEKO/app-2026-08-01.log app.log 2>/dev/null \
  || cp "/media/$USER/DATAEKO/app-2026-08-01.log" app.log 2>/dev/null \
  || cp /mnt/e/app-2026-08-01.log app.log 2>/dev/null \
  || echo "come and take app-2026-08-01.log off the USB stick — save it here as app.log"
cat > logsum.sh <<'EOF'
#!/usr/bin/env bash
logfile="app.log"
echo "reading $logfile"
EOF
chmod +x logsum.sh
./logsum.sh
ls -l app.log
1/30 exit