Sign inSign up free

1422. Combined: Works in My Shell, Fails in the Pipeline

medium 20 XP ~10 minHands-on lab

/opt/telemetry/bin/report.sh adds up the numbers in the tool's data file. Its author tests it with cd /opt/telemetry && bash bin/report.sh and it works. The deploy pipeline runs it like this, and it fails:

cd / && /opt/telemetry/bin/report.sh

The pipeline runs it with /bin/sh and PATH=/usr/bin:/bin. You can't change the pipeline.

Task

  • Run the pipeline's way, from any directory, the script exits successfully and prints total: N, the sum of the numbers in /opt/telemetry/data/input.txt.
  • The script stays at /opt/telemetry/bin/report.sh, and the data file stays where it is.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Part of Linux Incidents, Two Faults at a Time. Next step: Combined: The Cron Job That Works When I Run It

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.