POSIX shell function to "dump" all given arguments
printf '%b' &quot;dump_arguments()\\n----------------\\n$# arguments are being inspected&quot;


We could make that easier to read by making each line a separate argument, and ending the line properly (rather than requiring a separate command):
punct=.
${1+false} true || punct=:
printf '%s\n'                                       \
       'dump_arguments()'                           \
       '----------------'                           \
       &quot;$# arguments are being inspected$punct&quot;

It seems odd to use %s here:

    printf '%s' &quot;[$i]: '$1'&quot;


Why not use the format string more clearly?  And this allows us to modify to use %q if we have a suitable printf:
    printf &quot;[%d]: '%s'&quot; &quot;$i&quot; &quot;$1&quot;

Perhaps even combine the type into a single print:
    type=
    [ -z &quot;$1&quot; ] &amp;&amp; type=' (empty)'
    [ &quot;$1&quot; -eq &quot;$1&quot; ] 2&gt;/dev/null &amp;&amp; type=' (integer)'
    printf &quot;[%d]: '%s'%s\n&quot; &quot;$i&quot; &quot;$1&quot; &quot;$type&quot;

Is it intentional that strings such as ' 5' (with leading and/or trailing spaces) are counted as integers?

    shift 1


Normally written simply as
    shift

That said, I think it's more natural to iterate over arguments using a for loop instead.

} &gt;&amp;2


That's surprising, as the output isn't an error, but expected when calling the function.  It should be up to the caller to choose where stream 1 goes.

Modified code
#!/bin/sh

dump_arguments()
# string function - prints arguments (position and content)
# indicates empty arguments and integer numbers
{
    punct=${1+:}
    printf '%s\n'                                               \
           'dump_arguments()'                                   \
           '----------------'                                   \
           &quot;$# arguments are being inspected${punct:-.}&quot;
    i=1
    for v
    do
        if [ -z &quot;$v&quot; ]
        then type=' (empty)'
        elif [ &quot;$v&quot; -eq &quot;$v&quot; ] 2&gt;/dev/null
        then type=' (integer)'
        else type=
        fi
        printf &quot;[%d]: '%s'%s\n&quot; \
               &quot;$i&quot;   &quot;$v&quot; &quot;$type&quot;
        i=$((i+1))
    done
}