sajad torkamani
#!/usr/bin/env bash

set -euo pipefail

# Your code...
  • set -e: Exit the script if any command returns a non-zero status code.
  • set -u: Exit the script with an error if any undefined variables are referenced.
  • set -o pipefail: If any command in a pipeline fails, use that as the return code of the pipeline instead of using the return code of the last command. This helps surface errors in a pipeline immediately and makes debugging easier.

Links