Reputation: 553
The aim is to to draw a line across a terminal using only zsh builtins.
Note that a similar question has been asked already about bash. This one is specific to zsh.
Upvotes: 0
Views: 397
Reputation: 553
This code
print -- ${(l:COLUMNS::─:)}
Prints this line
──────────────────────────────────────────────────────────────
Note: The character (─) is a box drawing character, not a hyphen. Also, COLUMNS
is a zsh parameter whose value is the width of the terminal. You could replace that with a specific width, e.g., 80.
Upvotes: 2