Is there any built-in linux command that allows to output a string that is n times an input string??
feedback
|
| |||||||||||||
feedback
|
|
Here's an old-fashioned way that's pretty portable:
This is a more conventional version of Adrian Petrescu's answer using brace expansion:
That's equivalent to:
This is a little more concise and dynamic version of pike's answer:
| |||||
feedback
|
|
Perhaps another way that is more general and useful for you:
The bash shell is more powerful than most people think :) | |||||
feedback
|
|
Quite a few good ways already mentioned. Can't forget about good old [john@awesome]$for i in `seq 5`; do echo "Hi";done Hi Hi Hi Hi Hi | ||||
|
feedback
|
|
Not exactly built in to linux, but if you have python installed..
| |||||||||
feedback
|
outputs
| |||
|
feedback
|
Where # is the number in seconds you want the command to be repeated. | ||||
|
feedback
|
|
Assuming you want something like Perl's
I explicitly used a | ||||
|
feedback
|
|
repeat
| |||
|
feedback
|
|
This can be parameterized and doesn't require a temp variable, FWIW:
Or, if
| |||
|
feedback
|