#!/usr/bin/env bash # printf pads to width 10, then tr fills the spaces with '=' line=$(printf '%*s' 10 '' | tr ' ' '=') echo "$line"
printf and tr build a repeated string