anchor.diff:  # Writing Build Scripts
  -
  -Steps in your build pipelines are most often just shell scripts that are checked in alongside your code. The [Buildkite Agent](/docs/agent) will run your scripts, capture and report the log output, and use the exit status to mark the build as passed or failed.
  +One of the most popular actions that Buildkite pipeline steps perform is running a shell script. These scripts are checked in alongside your code and `pipeline.yml` file. The [Buildkite Agent](/docs/agent) will run your scripts, capture and report the log output, and use the exit status to mark each job, as well as the overall build, as passed or failed.
   
   <%= toc %>
   
  
positive.code:   </tbody>
  </table>
  
  Most build scripts should set the `-e` and `-o pipefail` options to ensure if any command fails your entire build script fails. For example:
  
  ```bash
  #!/bin/bash
  
negative.code: run_my_tests
  ```
  
  However, if you need to perform tasks after your main command executes (regardless of success or failure), you’ll need to [capture the exit status](#capturing-exit-status) of your command yourself instead of using `set -e`.
  
  ## Capturing Exit Status
  
  