Challenge 3: Make a Script Reusable — Possible Solution ==================================================================== #!/bin/bash # get-orders.sh curl -H "Authorization: Bearer $TOKEN" "$BASE_URL/orders" Used as: export BASE_URL="https://api.example.com" export TOKEN="abc123" ./get-orders.sh WHY THIS WORKS AS AN ANSWER ------------------------------ Both the hardcoded token (abc123) and the hardcoded base URL are replaced with $TOKEN and $BASE_URL — shell variables read from the environment rather than literal values baked into the file itself. This means the exact same script file works for dev, staging, or production simply by exporting different values before running it — no editing the script at all — the same benefit Chapter 3's Postman environments and Chapter 5's .http environment files provide, just expressed as shell environment variables instead. It also directly resolves this chapter's closing gotcha: since the real token value now lives only in the calling shell's environment (or a separate, gitignored file sourced before running the script), the script file itself contains no secret at all and is safe to commit to a shared repository.