BASH打印指定数量字符
repete print
printf "=%0.s" {1..20}
num=`printf "=%0.s" {1..20}`
echo -e "\n${#num}\n"

repete print number as a variable
num=30
eval printf "=%0.s" {1..${num}}
str=`eval printf "=%0.s" {1..${num}}`
echo -e "\nthe length of str is ${#str}"


浙公网安备 33010602011771号