# Shell Style Guide

#### Shell Script Heading

```shell
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 Tomáš Havlas <tomas@havlas.me>
```

##### Bash "Strict Mode"

```shell
set -euo pipefail
```

#### Error Log Function with Timestamp

```shell
function log() {
  echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" >&2
}

if ! do_something; then
  log "Unable to do_something"
  exit 1
fi
```