That doesn't work because printf requires two arguments, a format string and a list of variables to coerce into the format. If you say printf $newarray (a rather odd choice of variable name, BTW) then you're only sending one argument to printf. You can do what you want by simply doing: