The /usr/sbin/paperconfig script uses an internal shell variable
named PAPERSIZE, which contains the full path to a papersize file.
This usage conflicts with the environment variable of the same name,
which according to the paper(1) man page, does not contain such a path,
but instead contains the name of a particular media size to be used.
The collision can be demonstrated with a simple sequence of commands:
#!/bin/bash
# Simple setup, to clarify the output.
PATH=/usr/bin:/usr/sbin
LINE=--------------------------------
# Log the commands used in this test.
set -x
# First clear any inherited value in the environment,
# and prove that the clearing has actually occurred.
( set +x; echo $LINE ) 2>/dev/null
printenv PAPERSIZE
export -n PAPERSIZE
printenv PAPERSIZE
# Look at the default paper size.
( set +x; echo $LINE ) 2>/dev/null
paper
paperconf
paperconfig
# Set the paper size to a known non-default value.
( set +x; echo $LINE ) 2>/dev/null
export PAPERSIZE=Letter
# Look to see what effect that environment variable has.
( set +x; echo $LINE ) 2>/dev/null
paper
paperconf
paperconfig
# End this test.
( set +x; echo $LINE ) 2>/dev/null
Here's the output I get from that script, when run in my local
Debian 13.7 context: