If I want to print 60 dashes.
Somehow like
echo "-" * 60
.
How can I do with this? Thanks.
If I want to print 60 dashes.
Somehow like
echo "-" * 60
.
How can I do with this? Thanks.
printf "%*s" 60 "" | tr " " "-"
The printf command prints an empty string padded with spaces to fit a width of 60. Then tr converts the spaces to dashes.
This does not print a trailing newline. If you want one, add ;echo
to the end of the command.