ubuntu - How can i do "-" * 60 for Unix command line -
this question has answer here:
- how can repeat character in bash? 17 answers
if want print 60 dashes.
somehow
echo "-" * 60
.
how can this? thanks.
printf "%*s" 60 "" | tr " " "-"
the printf command prints empty string padded spaces fit width of 60. tr converts spaces dashes.
this not print trailing newline. if want one, add ;echo
end of command.
Comments
Post a Comment