As an alternative to the hairy for loop, how about: <code>
dd if=/dev/zero ibs=${char_number} count=1 2>/dev/null | tr '\0' '#'
</code> ?