GETCONF(1) User Commands GETCONF(1)

getconf - get configuration values

getconf [-v specification] system_var
getconf [-v specification] path_var pathname
getconf -a

The getconf command prints values of system configuration variables. It is a command interface to the values returned by sysconf(3), confstr(3), and pathconf(3). The system_var or path_var arguments, respectively, specify the parameter name to be queried. `_SC_', `_CS_', and `_PC_' prefixes must sometimes be omitted from the parameter names, as well as leading underscores. The pathname argument is passed to pathconf(3).

The -v option indicates that values according to a specific specification be queried. It has currently no effect.

With the -a option, all available configuration variables and their values are printed.

The local variable `HEIRLOOM_TOOLCHEST_VERSION' is also available. It prints the installed version of the Heirloom Toolchest in the format `YYYYMMDD'.

The values printed by getconf differ between the POSIX.2-1992 version in /usr/5bin/posix/getconf and the POSIX.1-2001 version in /usr/5bin/posix2001/getconf.

The `PATH' variable specifies a value for the corresponding shell parameter that makes all utilities act as specified in the POSIX standard. Thus after executing

PATH=`getconf PATH` export PATH

a script can rely on POSIX behavior. Note that this does not affect the shell which executes the script.

The `POSIX2_VERSION' variable gives the version of the POSIX standard to which the utilities and getconf itself correspond. Thus if POSIX.1-2001 behavior is required by a script,

posix2_version=`getconf POSIX2_VERSION`
if test ${posix2_version:-0} -lt 200112
then

echo "error: POSIX.1-2001 or later required" >&2
exit fi

aborts the script if the requirement is not satisfied.

intro(1), confstr(3), pathconf(3), sysconf(3)

The availability of many variables and many of the values depend on the host platform and not on the Heirloom Toolchest.

8/14/05 Heirloom Toolchest