Repeat a string: Difference between revisions

Content added Content deleted
(→‎{{header|UNIX Shell}}: Found head -c in GNU Coreutils manual, it must be GNU extension.)
Line 856: Line 856:
eval "printf '${1}%.0s' {1..${2}}"
eval "printf '${1}%.0s' {1..${2}}"
}</lang>
}</lang>

===Using head -c===
<code>head -c</code> is a [[GNU]] extension, so it only works with those systems. (Also, this script can only repeat a single character.)


{{works with|Bourne Shell}}
{{works with|Bourne Shell}}