> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bash Step Sequence

A Bash step sequence is an extension of brace expansion that generates a discrete, ordered list of integers or single characters separated by a defined interval. It evaluates statically during the shell's initial parsing phase, strictly prior to tilde expansion, parameter expansion, command substitution, or arithmetic expansion.

## Syntax

```bash theme={"dark"}
{<start>..<end>..<step>}
```

## Parameters

* **`start`**: The initial integer or single ASCII character.
* **`end`**: The terminal integer or character. The sequence generation halts at or immediately before this boundary.
* **`step`**: An integer defining the interval between consecutive elements. Bash evaluates this as an absolute value; negative signs are ignored.

## Core Mechanics

**Directionality**
Bash automatically infers the direction of the sequence (incrementing or decrementing) based on the relationship between `start` and `end`. The `step` parameter is always treated as a positive absolute magnitude, regardless of the provided sign.

```bash theme={"dark"}

# Ascending sequence
echo {1..10..3}

# Output: 1 4 7 10


# Descending sequence
echo {10..1..3}

# Output: 10 7 4 1


# Negative step value (sign is ignored)
echo {1..5..-2}

# Output: 1 3 5
```

**Type Constraints**
The `start` and `end` parameters must be of the same data type—either both integers or both alphabetic characters. Mixing types or using multi-character strings invalidates the syntax, resulting in no expansion.

```bash theme={"dark"}

# Character sequence
echo {a..k..2}

# Output: a c e g i k


# Invalid mixed-type sequence (remains unexpanded)
echo {1..z..2}

# Output: {1..z..2}
```

**Zero-Padding**
If either the `start` or `end` integer is prefixed with a `0`, Bash forces all generated elements to be zero-padded. The padding width is determined by the length of the longest boundary string.

```bash theme={"dark"}

# Zero-padded sequence
echo {05..15..5}

# Output: 05 10 15
```

**Evaluation Order Limitations**
Because brace expansion is the very first expansion performed by the Bash interpreter, the `start`, `end`, and `step` parameters must be hardcoded literals. Attempting to use variables to define the sequence boundaries or step will fail to generate the sequence. The braces and dots are bypassed during the brace expansion phase because the variables are not yet evaluated as valid integers or characters. The variables are subsequently interpolated during the parameter expansion phase, leaving the braces intact.

```bash theme={"dark"}

# Invalid: Brace expansion occurs before parameter expansion
START=1
END=5
STEP=2
echo {$START..$END..$STEP}

# Output: {1..5..2}
```

*(Note: To achieve dynamic step sequences using variables, developers must use the C-style `for ((i=start; i<=end; i+=step))` loop syntax or the external `seq` binary, as native brace expansion cannot evaluate variables).*

**Version Requirement**
The step parameter syntax (`..step`) was introduced in **Bash 4.0**. In older versions (Bash 3.x), appending a step value will cause the entire expression to be treated as a literal string.

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor Bash Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
