RosettaCodeData/Task/Repeat-a-string/UNIX-Shell/repeat-a-string-4.sh
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

5 lines
130 B
Bash

reprint() {
typeset e="$(sed -e 's,%,%%,g' -e 's,\\,\\\\,g' <<<"$1")"
eval 'printf "$e"%.0s '"{1..$2}"
}
reprint '% ha \' 5