bash has a builtin printf so it's fast, like echo. Use printf -v MYVAR '%fmt' args to"print" into the variable MYVAR.
0
1
3
0
0