Screen Too Small

This course material requires a larger screen to properly display the terminal and editor interfaces.

Please use a tablet, laptop, or desktop computer for the best learning experience.

You can continue browsing, but the experience will be significantly limited.

Ship It or Sink: The Dev vs. Prod Toggle Script

Release imminent! Boss 'Captain Deadline' yells: 'SHIP IT OR WE SINK!'

You have one bash script with markers: #DEV_ONLY and #PROD_ONLY.

Rules:
- #DEV_ONLY → comment out (add leading #).
- #PROD_ONLY → uncomment (remove leading #).
- Both → Prod wins (line stays active).

Fix it in five minutes or suffer a 200-slide Lunch 'n Learn on our release process.

Starting Text

vim@sandbox: ~/start.txt
vim
#!/bin/bash echo "Starting Script..." #DEV_ONLY # echo "Debugging enabled!" #DEV_ONLY export API_KEY="P@ssw0rd" #DEV_ONLY # export API_KEY="prod-super-secret" #PROD_ONLY echo "Running test harness" #DEV_ONLY export LOG_LEVEL="DEBUG" #DEV_ONLY # export LOG_LEVEL="INFO" #PROD_ONLY echo "Mixed line" #DEV_ONLY #PROD_ONLY echo "All done."

Expected Output

vim@sandbox: ~/expected.txt
vim
#!/bin/bash # echo "Starting Script..." #DEV_ONLY # echo "Debugging enabled!" #DEV_ONLY # export API_KEY="P@ssw0rd" #DEV_ONLY export API_KEY="prod-super-secret" #PROD_ONLY # echo "Running test harness" #DEV_ONLY # export LOG_LEVEL="DEBUG" #DEV_ONLY export LOG_LEVEL="INFO" #PROD_ONLY echo "Mixed line" #DEV_ONLY #PROD_ONLY echo "All done."

Hold on, cowboy

You gotta sign up to view challenges

New challenges appear every week. They're fun, and insightful

Sign up or sign in now!