Writing a line with equal signs or hyphens in Perl or Python is straight forward. However doing this in bash bash required a different printf format string.
| Version | Date | Notes |
|---|---|---|
| 0.1.2 | 2024-01-29 | Fix code fences |
| 0.1.1 | 2024-01-25 | Add python, history, introduction |
| 0.1.0 | 2023-05-15 | Initial release |
Perl
my $line = "=" x 80;
Python
line = "=" * 80
Bash
line=$(printf '=%.0s' {1..80})
Unlike ‘String Composed of 80 Equals’ the solution has to be different, otherwise printf gets confused.
Perl
my $line = "-" x 80;
Python
line = "-" * 80
Bash
line=$(printf '%0.s-' {1..80})