.\" .\" Copyright (c) 2005 Gunnar Ritter .\" .\" This software is provided 'as-is', without any express or implied .\" warranty. In no event will the authors be held liable for any damages .\" arising from the use of this software. .\" .\" Permission is granted to anyone to use this software for any purpose, .\" including commercial applications, and to alter it and redistribute .\" it freely, subject to the following restrictions: .\" .\" 1. The origin of this software must not be misrepresented; you must not .\" claim that you wrote the original software. If you use this software .\" in a product, an acknowledgment in the product documentation would be .\" appreciated but is not required. .\" .\" 2. Altered source versions must be plainly marked as such, and must not be .\" misrepresented as being the original software. .\" .\" 3. This notice may not be removed or altered from any source distribution. .\" .\" Sccsid @(#)getconf.1 1.4 (gritter) 8/14/05 .TH GETCONF 1 "8/14/05" "Heirloom Toolchest" "User Commands" .SH NAME getconf \- get configuration values .SH SYNOPSIS \fBgetconf\fR [\fB\-v\fI\ specification\fR] \fIsystem_var\fR .br \fBgetconf\fR [\fB\-v\fI\ specification\fR] \fIpath_var pathname\fR .br \fBgetconf \-a\fR .SH DESCRIPTION The .I getconf command prints values of system configuration variables. It is a command interface to the values returned by .IR sysconf (3), .IR confstr(3), and .IR pathconf (3). The .I system_var or .I 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 .I pathname argument is passed to .IR pathconf (3). .PP The .B \-v option indicates that values according to a specific specification be queried. It has currently no effect. .PP With the .B \-a option, all available configuration variables and their values are printed. .PP The local variable `HEIRLOOM_TOOLCHEST_VERSION' is also available. It prints the installed version of the Heirloom Toolchest in the format `YYYYMMDD'. .PP The values printed by .I getconf differ between the POSIX.2-1992 version in .B /usr/5bin/posix/getconf and the POSIX.1-2001 version in .BR /usr/5bin/posix2001/getconf . .SH EXAMPLES 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 .RS .sp .nf PATH=\`getconf PATH\` export PATH .fi .sp .RE a script can rely on POSIX behavior. Note that this does not affect the shell which executes the script. .PP The `POSIX2_VERSION' variable gives the version of the POSIX standard to which the utilities and .I getconf itself correspond. Thus if POSIX.1-2001 behavior is required by a script, .RS .sp .nf posix2_version=\`getconf POSIX2_VERSION\` if test ${posix2_version:\-0} \-lt 200112 then echo "error: POSIX.1-2001 or later required" >&2 exit fi .fi .sp .RE aborts the script if the requirement is not satisfied. .SH "SEE ALSO" intro(1), confstr(3), pathconf(3), sysconf(3) .SH NOTES The availability of many variables and many of the values depend on the host platform and not on the Heirloom Toolchest.