Reputation: 69
I would like to know how can I echo the same number of # or * based of a number I type?
For example.
If I type/have 3, I would like to have as return ###.
Thank you!
Upvotes: 0
Views: 81
Reputation: 290105
You can say:
$ num=3
$ printf "%0.s*" $(seq $num)
***
And if the number is fixed, use brace expansion {..}
:
$ printf "%0.s*" {1..3}
***
Upvotes: 2