TheBonsai 1251632877 learn Bash's printf can assign directly to a variable, rather than output to stdout. printf -v VAR ..... e36freak 1319822794 forget e36freak 1319822799 learn Instead of capturing the output of printf, bash's printf can be assigned directly to a variable. printf -v myvarname %04d "$i"