Repeat a string: Difference between revisions
Content added Content deleted
(Add Bash example) |
|||
Line 64: | Line 64: | ||
Return Output |
Return Output |
||
}</lang> |
}</lang> |
||
=={{header|Bash}}== |
|||
<lang bash>printf "ha%.0s" {1..5}</lang> |
|||
A slightly more generic version |
|||
<lang bash>s="ha" |
|||
r=5 |
|||
eval "printf '${s}%.0s' {1..${r}}"</lang> |
|||
=={{header|Batch File}}== |
=={{header|Batch File}}== |