Day 27 10 min
sed
1 / 13 · ≈ 9 min left
The problem
The staging server is gone and every host in deploy.conf must now point at production. Opening the file in an editor on a box over SSH works once. On 40 boxes, sed does the same edit from one command line: it reads the file line by line, runs a short script on each line and prints the result.
The reps use GNU sed on this 7-line deploy.conf. Line 1: # deploy settings. Line 2: host=staging.example.com. Line 3: port=8080. Line 4: path=/var/www/app. Line 5: # health check. Line 6: url=http://staging.example.com/staging/health. Line 7: debug=true. Unless the prompt says otherwise, print the result and leave the file as it is.