IEEE P1003.2 Draft 11.2 - September 1991 Copyright (c) 1991 by the Institute of Electrical and Electronics Engineers, Inc. 345 East 47th Street New York, NY 10017, USA All rights reserved as an unpublished work. This is an unapproved and unpublished IEEE Standards Draft, subject to change. The publication, distribution, or copying of this draft, as well as all derivative works based on this draft, is expressly prohibited except as set forth below. Permission is hereby granted for IEEE Standards Committee participants to reproduce this document for purposes of IEEE standardization activities only, and subject to the restrictions contained herein. Permission is hereby also granted for member bodies and technical committees of ISO and IEC to reproduce this document for purposes of developing a national position, subject to the restrictions contained herein. Permission is hereby also granted to the preceding entities to make limited copies of this document in an electronic form only for the stated activities. The following restrictions apply to reproducing or transmitting the document in any form: 1) all copies or portions thereof must identify the document's IEEE project number and draft number, and must be accompanied by this entire notice in a prominent location; 2) no portion of this document may be redistributed in any modified or abridged form without the prior approval of the IEEE Standards Department. Other entities seeking permission to reproduce this document, or any portion thereof, for standardization or other activities, must contact the IEEE Standards Department for the appropriate license. Use of information contained in this unapproved draft is at your own risk. IEEE Standards Department Copyright and Permissions 445 Hoes Lane, P.O. Box 1331 Piscataway, NJ 08855-1331, USA +1 (908) 562-3800 +1 (908) 562-1571 [FAX] Part 2: SHELL AND UTILITIES P1003.2/D11.2 The working group received substantial input from representatives of the University of California at Berkeley and from companies that are firmly allied with BSD versions of the UNIX system, enough so that some BSD- derived utilities are included in the standard. However, this Rationale is now limited to a discussion of only those utilities actively or indirectly evaluated by the working group, rather than the list of all known UNIX utilities from all its variants. This list will most likely be augmented during the balloting process as balloters request specific rationales for their favorite commands. In the list, the notation [_P_O_S_I_X._2_a] is used to identify utilities that are being evaluated for inclusion in the forthcoming User Portability Extension to this standard. Similarly, [_P_O_S_I_X._7] is used for those that may be appropriate for the working group evaluating system administration and [_P_O_S_I_X._N_e_t] for networking standards. adb The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This utility is primarily a debugging tool. Furthermore, many useful aspects of adb are very hardware-specific. admin The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This SCCS utility is primarily a development tool. as Assemblers are hardware-specific and are included implicitly as part of the compilers in the standard. at The at and cron family of utilities were omitted because portable applications could not rely on their behavior. [_P_O_S_I_X._2_a] banner The only known use of this command is as part of the LP printer header pages. It was decided that the format of the header is implementation defined, so this utility is superfluous to application portability. batch The at and cron family of utilities were omitted because portable applications could not rely on their behavior. [_P_O_S_I_X._2_a] cal This calendar printing program is not useful to portable applications. calendar This reminder service program is not useful to portable applications. Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. E.4 Execution Environment Utilities 981 P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX cancel The LP (line printer spooling) system specified is the most basic possible and did not need this level of application control. [_P_O_S_I_X._7] cflow The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This utility is primarily a debugging tool. chroot This is primarily of administrative use, requiring super- user privileges. [_P_O_S_I_X._7] col No utilities defined in this standard produce output requiring such a filter. The nroff text formatter is present on many historical systems and will continue to remain as an extension; col is expected to be shipped by all the systems that ship nroff. cpio This has been replaced by pax, for reasons explained in its own Rationale. cpp Can be subsumed by c89. crontab The at and cron family of utilities were omitted because portable applications could not rely on their behavior. [_P_O_S_I_X._2_a] csplit This utility's functionality can sometimes be provided by the dd or sed utilities (i.e., although these utilities cannot easily provide all of csplit'_s features in one package, they can frequently be used for the type of task that csplit is being used for). [_P_O_S_I_X._2_a] cu Terminal oriented-not useful from shell scripts or typical application programs. [_P_O_S_I_X._N_e_t] cxref The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This utility is primarily a debugging tool. dc This utility's functionality can be provided by the bc utility; bc was selected because it was easier to use and had superior functionality. Although the historical versions of bc are implemented using dc as a base, this standard prescribes the interface and not the underlying mechanism used to implement it. Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 982 E Rationale and Notes Part 2: SHELL AND UTILITIES P1003.2/D11.2 delta The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This SCCS utility is primarily a development tool. df As the standard does not address the concept or nature of file systems, this command could not be specified in a manner useful to portable applications. [_P_O_S_I_X._2_a] dircmp Although a useful concept, the traditional output of this directory comparison program is not suitable for processing in applications programs. Also, the diff -r command gives equivalent functionality. dis Disassemblers are hardware-specific. du Because of differences between systems in measuring disk usage, this utility could not be used reliably by a portable application. [_P_O_S_I_X._2_a] egrep Marked obsolescent and replaced by the new version of grep. ex This is typically a link to the vi terminal-oriented editor-not useful from shell scripts or typical application programs. The nonterminal oriented facilities of ex are provided by ed. [_P_O_S_I_X._2_a] fgrep Marked obsolescent and replaced by the new version of grep. file Determining the type of file is generally accomplished with test or find. The added information available with file is of little use to a portable application, particularly since there is considerable variation in its output contents. [_P_O_S_I_X._2_a] get The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This SCCS utility is primarily a development tool. ld Is subsumed by c89. line The functionality of line can be provided with read. lint The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This utility Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. E.4 Execution Environment Utilities 983 P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX is primarily a debugging tool. login Terminal oriented-not useful from shell scripts or typical application programs. lorder This utility is an aid in creating an implementation- specific detail of object libraries that the working group did not feel required standardization. lpstat The LP system specified is the most basic possible and did not need this level of application control. [_P_O_S_I_X._7] m4 The working group did not find that this macro processor had sufficiently wide usage for standardization. mail This utility was omitted in favor of mailx, because there was a considerable functionality overlap between the two. The mail-sending aspects of mailx are covered in this standard, the mail-reading in the UPE. [_P_O_S_I_X._2_a] mesg Terminal oriented-not useful from shell scripts or typical application programs. [_P_O_S_I_X._2_a] mknod This was omitted in favor of mkfifo, as mknod has too many implementation-defined functions. [_P_O_S_I_X._7] newgrp Terminal oriented-not useful from shell scripts or typical application programs. [_P_O_S_I_X._2_a] news Terminal oriented-not useful from shell scripts or typical application programs. nice Due to historical variations in usage, and in the lack of underlying support from possible POSIX.1 {8} base systems, this cannot be used by applications to achieve reliable results. [_P_O_S_I_X._2_a] nl The useful functionality of nl can be provided with pr. nm The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This utility is primarily a debugging tool. [_P_O_S_I_X._2_a] pack The working group found little interest in a portable data compression program (and there are others that are probably more widely used anyway). Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 984 E Rationale and Notes Part 2: SHELL AND UTILITIES P1003.2/D11.2 passwd Terminal oriented-not useful from shell scripts or typical application programs. (There was also sentiment to avoid security-related utilities until requirements of 1003.6 are known.) pcat The working group found little interest in a portable data compression program (and there are others that are probably more widely used anyway). pg Terminal oriented-not useful from shell scripts or typical application programs. prof The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This utility is primarily a debugging tool. prs The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This SCCS utility is primarily a development tool. ps This utility has historically been difficult to specify portably due to the many implementation-defined aspects of processes. Furthermore, a portable application can rarely rely on information about what other processes are doing, as security mechanisms may prevent it. A process requiring one of its children's process IDs (such as for use with the kill command) will have to record the IDs at the time of creation. [_P_O_S_I_X._2_a] red Restricted editor. This was not considered by the working group because it never provided the level of security restriction required. rmdel The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This SCCS utility is primarily a development tool. rsh Restricted shell. This was not considered by the working group because it does not provide the level of security 1 restriction that is implied by historical documentation. 1 sact The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This SCCS utility is primarily a development tool. Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. E.4 Execution Environment Utilities 985 P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX sdb The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This utility is primarily a debugging tool. Furthermore, some useful aspects of sdb are very hardware-specific. sdiff The ``side-by-side diff'' utility from System V was omitted because it is used infrequently, and even less so by portable applications. Despite being in System V, it is not in the _S_V_I_D or _X_P_G. shar Utilities with this type of functionality (``shell-based archivers'') are in wide use, despite not being included in System V or BSD systems. However, the working group felt this sort of program was more widely used by human users than portable applications. shl Terminal oriented-not useful from shell scripts or typical application programs. The job control aspects of the Shell Command Language are generally more useful and are being evaluated for the UPE. size The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This utility is primarily a debugging tool. spell Not useful from shell scripts or typical application programs. split The functionality can sometimes be provided by the dd, sed, or (for some uses) xargs utilities (i.e., although these utilities cannot easily provide all of split'_s features in one package, they can sometimes be used for the type of task that split is being used for). [_P_O_S_I_X._2_a] strings This is normally used by human users during debugging, rather than by applications. [_P_O_S_I_X._2_a] su Not useful from shell scripts or typical application programs. (There was also sentiment to avoid security- related utilities until requirements of POSIX.6 are known.) sum This utility was renamed cksum. tabs Terminal oriented-not useful from shell scripts or typical application programs. [_P_O_S_I_X._2_a] Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 986 E Rationale and Notes Part 2: SHELL AND UTILITIES P1003.2/D11.2 time Not necessary for portable applications. It is frequently used by human users in debugging or for informal benchmarks. It is doubtful whether any standardized definitions of the output could be agreed upon. tsort This utility is an aid in creating an implementation- specific detail of object libraries that the working group did not feel required standardization. unget The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This SCCS utility is primarily a development tool. unpack The working group found little interest in a portable data compression program (and there are others that are probably more widely used anyway). uucp uulog uupick uustat uuto The UUCP utilities and their protocol description were 1 removed from an early draft because responsibility for 1 them was officially requested by the POSIX group 1 developing networking interfaces. 1 val The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This SCCS utility is primarily a development tool. vi Terminal oriented-not useful from shell scripts or typical application programs. [_P_O_S_I_X._2_a] wall Terminal oriented-not useful from shell scripts or typical application programs. It is generally used by system administrators, as well. [_P_O_S_I_X._7] what The intent of the various software development utilities was to assist in the installation (rather than the actual development and debugging) of applications. This SCCS utility is primarily a development tool. who The ability to determine other users on the system was felt to be at risk in a trusted implementation, so its use could not be considered by a portable application. Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. E.4 Execution Environment Utilities 987 P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX [_P_O_S_I_X._2_a] write Terminal oriented-not useful from shell scripts or typical application programs. [_P_O_S_I_X._2_a] _E._4._1 awk - _P_a_t_t_e_r_n _s_c_a_n_n_i_n_g _a_n_d _p_r_o_c_e_s_s_i_n_g _l_a_n_g_u_a_g_e _E._4._2 basename - _R_e_t_u_r_n _n_o_n_d_i_r_e_c_t_o_r_y _p_o_r_t_i_o_n _o_f _p_a_t_h_n_a_m_e _E._4._3 bc - _A_r_b_i_t_r_a_r_y-_p_r_e_c_i_s_i_o_n _a_r_i_t_h_m_e_t_i_c _l_a_n_g_u_a_g_e _E._4._4 cat - _C_o_n_c_a_t_e_n_a_t_e _a_n_d _p_r_i_n_t _f_i_l_e_s _E._4._5 cd - _C_h_a_n_g_e _w_o_r_k_i_n_g _d_i_r_e_c_t_o_r_y _E._4._6 chgrp - _C_h_a_n_g_e _f_i_l_e _g_r_o_u_p _o_w_n_e_r_s_h_i_p _E._4._7 chmod - _C_h_a_n_g_e _f_i_l_e _m_o_d_e_s _E._4._8 chown - _C_h_a_n_g_e _f_i_l_e _o_w_n_e_r_s_h_i_p _E._4._9 cksum - _W_r_i_t_e _f_i_l_e _c_h_e_c_k_s_u_m_s _a_n_d _b_l_o_c_k _c_o_u_n_t_s _E._4._1_0 cmp - _C_o_m_p_a_r_e _t_w_o _f_i_l_e_s _E._4._1_1 comm - _S_e_l_e_c_t _o_r _r_e_j_e_c_t _l_i_n_e_s _c_o_m_m_o_n _t_o _t_w_o _f_i_l_e_s _E._4._1_2 command - _S_e_l_e_c_t _o_r _r_e_j_e_c_t _l_i_n_e_s _c_o_m_m_o_n _t_o _t_w_o _f_i_l_e_s _E._4._1_3 cp - _C_o_p_y _f_i_l_e_s Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 988 E Rationale and Notes Part 2: SHELL AND UTILITIES P1003.2/D11.2 _E._4._1_4 cut - _C_u_t _o_u_t _s_e_l_e_c_t_e_d _f_i_e_l_d_s _o_f _e_a_c_h _l_i_n_e _o_f _a _f_i_l_e _E._4._1_5 date - _W_r_i_t_e _t_h_e _d_a_t_e _a_n_d _t_i_m_e _E._4._1_6 dd - _C_o_n_v_e_r_t _a_n_d _c_o_p_y _a _f_i_l_e _E._4._1_7 diff - _C_o_m_p_a_r_e _t_w_o _f_i_l_e_s _E._4._1_8 dirname - _R_e_t_u_r_n _d_i_r_e_c_t_o_r_y _p_o_r_t_i_o_n _o_f _p_a_t_h_n_a_m_e _E._4._1_9 echo - _W_r_i_t_e _a_r_g_u_m_e_n_t_s _t_o _s_t_a_n_d_a_r_d _o_u_t_p_u_t _E._4._2_0 ed - _E_d_i_t _t_e_x_t _E._4._2_1 env - _S_e_t _e_n_v_i_r_o_n_m_e_n_t _f_o_r _c_o_m_m_a_n_d _i_n_v_o_c_a_t_i_o_n _E._4._2_2 expr - _E_v_a_l_u_a_t_e _a_r_g_u_m_e_n_t_s _a_s _a_n _e_x_p_r_e_s_s_i_o_n _E._4._2_3 false - _R_e_t_u_r_n _f_a_l_s_e _v_a_l_u_e _E._4._2_4 find - _F_i_n_d _f_i_l_e_s _E._4._2_5 fold - _F_i_l_t_e_r _f_o_r _f_o_l_d_i_n_g _l_i_n_e_s _E._4._2_6 getconf - _G_e_t _c_o_n_f_i_g_u_r_a_t_i_o_n _v_a_l_u_e_s _E._4._2_7 getopts - _P_a_r_s_e _u_t_i_l_i_t_y _o_p_t_i_o_n_s _E._4._2_8 grep - _F_i_l_e _p_a_t_t_e_r_n _s_e_a_r_c_h_e_r Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. E.4 Execution Environment Utilities 989 P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX _E._4._2_9 head - _C_o_p_y _t_h_e _f_i_r_s_t _p_a_r_t _o_f _f_i_l_e_s _E._4._3_0 id - _R_e_t_u_r_n _u_s_e_r _i_d_e_n_t_i_t_y _E._4._3_1 join - _R_e_l_a_t_i_o_n_a_l _d_a_t_a_b_a_s_e _o_p_e_r_a_t_o_r _E._4._3_2 kill - _T_e_r_m_i_n_a_t_e _o_r _s_i_g_n_a_l _p_r_o_c_e_s_s_e_s _E._4._3_3 ln - _L_i_n_k _f_i_l_e_s _E._4._3_4 locale - _G_e_t _l_o_c_a_l_e-_s_p_e_c_i_f_i_c _i_n_f_o_r_m_a_t_i_o_n _E._4._3_5 localedef - _D_e_f_i_n_e _l_o_c_a_l_e _e_n_v_i_r_o_n_m_e_n_t _E._4._3_6 logger - _L_o_g _m_e_s_s_a_g_e_s _E._4._3_7 logname - _R_e_t_u_r_n _u_s_e_r'_s _l_o_g_i_n _n_a_m_e _E._4._3_8 lp - _S_e_n_d _f_i_l_e_s _t_o _a _p_r_i_n_t_e_r _E._4._3_9 ls - _L_i_s_t _d_i_r_e_c_t_o_r_y _c_o_n_t_e_n_t_s _E._4._4_0 mailx - _P_r_o_c_e_s_s _m_e_s_s_a_g_e_s _E._4._4_1 mkdir - _M_a_k_e _d_i_r_e_c_t_o_r_i_e_s _E._4._4_2 mkfifo - _M_a_k_e _F_I_F_O _s_p_e_c_i_a_l _f_i_l_e_s _E._4._4_3 mv - _M_o_v_e _f_i_l_e_s Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 990 E Rationale and Notes Part 2: SHELL AND UTILITIES P1003.2/D11.2 _E._4._4_4 nohup - _I_n_v_o_k_e _a _u_t_i_l_i_t_y _i_m_m_u_n_e _t_o _h_a_n_g_u_p_s _E._4._4_5 od - _D_u_m_p _f_i_l_e_s _i_n _v_a_r_i_o_u_s _f_o_r_m_a_t_s _E._4._4_6 paste - _M_e_r_g_e _c_o_r_r_e_s_p_o_n_d_i_n_g _o_r _s_u_b_s_e_q_u_e_n_t _l_i_n_e_s _o_f _f_i_l_e_s _E._4._4_7 pathchk - _C_h_e_c_k _p_a_t_h_n_a_m_e_s _E._4._4_8 pax - _P_o_r_t_a_b_l_e _a_r_c_h_i_v_e _i_n_t_e_r_c_h_a_n_g_e _E._4._4_9 pr - _P_r_i_n_t _f_i_l_e_s _E._4._5_0 printf - _W_r_i_t_e _f_o_r_m_a_t_t_e_d _o_u_t_p_u_t _E._4._5_1 pwd - _R_e_t_u_r_n _w_o_r_k_i_n_g _d_i_r_e_c_t_o_r_y _n_a_m_e _E._4._5_2 read - _R_e_a_d _a _l_i_n_e _f_r_o_m _s_t_a_n_d_a_r_d _i_n_p_u_t _E._4._5_3 rm - _R_e_m_o_v_e _d_i_r_e_c_t_o_r_y _e_n_t_r_i_e_s _E._4._5_4 rmdir - _R_e_m_o_v_e _d_i_r_e_c_t_o_r_i_e_s _E._4._5_5 sed - _S_t_r_e_a_m _e_d_i_t_o_r _E._4._5_6 sh - _S_h_e_l_l, _t_h_e _s_t_a_n_d_a_r_d _c_o_m_m_a_n_d _l_a_n_g_u_a_g_e _i_n_t_e_r_p_r_e_t_e_r _E._4._5_7 sleep - _S_u_s_p_e_n_d _e_x_e_c_u_t_i_o_n _f_o_r _a_n _i_n_t_e_r_v_a_l _E._4._5_8 sort - _S_o_r_t, _m_e_r_g_e, _o_r _s_e_q_u_e_n_c_e _c_h_e_c_k _t_e_x_t _f_i_l_e_s Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. E.4 Execution Environment Utilities 991 P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX _E._4._5_9 stty - _S_e_t _t_h_e _o_p_t_i_o_n_s _f_o_r _a _t_e_r_m_i_n_a_l _E._4._6_0 tail - _C_o_p_y _t_h_e _l_a_s_t _p_a_r_t _o_f _a _f_i_l_e _E._4._6_1 tee - _D_u_p_l_i_c_a_t_e _s_t_a_n_d_a_r_d _i_n_p_u_t _E._4._6_2 test - _E_v_a_l_u_a_t_e _e_x_p_r_e_s_s_i_o_n _E._4._6_3 touch - _C_h_a_n_g_e _f_i_l_e _a_c_c_e_s_s _a_n_d _m_o_d_i_f_i_c_a_t_i_o_n _t_i_m_e_s _E._4._6_4 tr - _T_r_a_n_s_l_a_t_e _c_h_a_r_a_c_t_e_r_s _E._4._6_5 true - _R_e_t_u_r_n _t_r_u_e _v_a_l_u_e _E._4._6_6 tty - _R_e_t_u_r_n _u_s_e_r'_s _t_e_r_m_i_n_a_l _n_a_m_e _E._4._6_7 umask - _G_e_t _o_r _s_e_t _t_h_e _f_i_l_e _m_o_d_e _c_r_e_a_t_i_o_n _m_a_s_k _E._4._6_8 uname - _R_e_t_u_r_n _s_y_s_t_e_m _n_a_m_e _E._4._6_9 uniq - _R_e_p_o_r_t _o_r _f_i_l_t_e_r _o_u_t _r_e_p_e_a_t_e_d _l_i_n_e_s _i_n _a _f_i_l_e _E._4._7_0 wait - _A_w_a_i_t _p_r_o_c_e_s_s _c_o_m_p_l_e_t_i_o_n _E._4._7_1 wc - _W_o_r_d, _l_i_n_e, _a_n_d _b_y_t_e _c_o_u_n_t _E._4._7_2 xargs - _C_o_n_s_t_r_u_c_t _a_r_g_u_m_e_n_t _l_i_s_t(_s) _a_n_d _i_n_v_o_k_e _u_t_i_l_i_t_y BEGIN_RATIONALE Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 992 E Rationale and Notes Part 2: SHELL AND UTILITIES P1003.2/D11.2 E.5 User Portability Utilities Option _E_d_i_t_o_r'_s _N_o_t_e: _T_h_i_s _s_e_c_t_i_o_n _i_s _u_n_u_s_e_d _i_n _t_h_i_s _r_e_v_i_s_i_o_n _o_f _t_h_e _s_t_a_n_d_a_r_d. BEGIN_RATIONALE E.6 Software Development Utilities Option _E_d_i_t_o_r'_s _N_o_t_e: _T_h_e _t_e_x_t _o_f _t_h_e _R_a_t_i_o_n_a_l_e _f_o_r _t_h_i_s _s_e_c_t_i_o_n _h_a_s _b_e_e_n _t_e_m_p_o_r_a_r_i_l_y _l_o_c_a_t_e_d _i_n _S_e_c_t_i_o_n _6, _a_d_j_a_c_e_n_t _t_o _t_h_e _t_e_x_t _i_t _i_s _e_x_p_l_a_i_n_i_n_g. _T_h_e _t_e_x_t _w_i_l_l _r_e_t_u_r_n _t_o _t_h_i_s _a_n_n_e_x _a_f_t_e_r _t_h_e _c_o_m_p_l_e_t_i_o_n _o_f _b_a_l_l_o_t_i_n_g. This is the first of the optional utility environments. The working group decided there were two basic classes of systems to be supported: general application execution and software development. The first is widely used and is the primary reason for the development of this standard. The second, however, represents only a (small?) subset of the first; the users are generally only those who are developing or installing C or FORTRAN applications. Therefore, all the development environments are optional, giving users the option of specifying a smaller, (presumably) less expensive system. There are three separate optional environments, so that C-only or FORTRAN-only users do not have to specify unneeded components. As further languages are supported by this standard, their environments will also be optional. An implementation must provide all three of these utilities to claim conformance to this section. See section E.4 for a discussion of utilities excluded from this group. E.6.1 ar - Create and maintain library archives E.6.2 make - Maintain, update, and regenerate groups of programs E.6.3 strip - Remove unnecessary information from executable files BEGIN_RATIONALE Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. E.6 Software Development Utilities Option 993 P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX E.7 Language-Independent System Services _E_d_i_t_o_r'_s _N_o_t_e: _T_h_e _t_e_x_t _o_f _t_h_e _R_a_t_i_o_n_a_l_e _f_o_r _t_h_i_s _s_e_c_t_i_o_n _h_a_s _b_e_e_n _t_e_m_p_o_r_a_r_i_l_y _l_o_c_a_t_e_d _i_n _S_e_c_t_i_o_n _7, _a_d_j_a_c_e_n_t _t_o _t_h_e _t_e_x_t _i_t _i_s _e_x_p_l_a_i_n_i_n_g. _T_h_e _t_e_x_t _w_i_l_l _r_e_t_u_r_n _t_o _t_h_i_s _a_n_n_e_x _a_f_t_e_r _t_h_e _c_o_m_p_l_e_t_i_o_n _o_f _b_a_l_l_o_t_i_n_g. E.7.1 Shell Command Interface E.7.2 Access Environment Variables E.7.3 Regular Expression Matching E.7.4 Pattern Matching E.7.5 Command Option Parsing E.7.6 Generate Pathnames Matching a Pattern E.7.7 Perform Word Expansions E.7.8 Get POSIX Configurable Variables E.7.9 Locale Control BEGIN_RATIONALE E.8 C Language Development Utilities Option _E_d_i_t_o_r'_s _N_o_t_e: _T_h_e _t_e_x_t _o_f _t_h_e _R_a_t_i_o_n_a_l_e _f_o_r _t_h_i_s _s_e_c_t_i_o_n _h_a_s _b_e_e_n _t_e_m_p_o_r_a_r_i_l_y _l_o_c_a_t_e_d _i_n _A_n_n_e_x _A, _a_d_j_a_c_e_n_t _t_o _t_h_e _t_e_x_t _i_t _i_s _e_x_p_l_a_i_n_i_n_g. _T_h_e _t_e_x_t _w_i_l_l _r_e_t_u_r_n _t_o _t_h_i_s _a_n_n_e_x _a_f_t_e_r _t_h_e _c_o_m_p_l_e_t_i_o_n _o_f _b_a_l_l_o_t_i_n_g. This is the second of the optional utility environments. An implementation must provide all three of these utilities to claim conformance to this section. Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 994 E Rationale and Notes Part 2: SHELL AND UTILITIES P1003.2/D11.2 See section E.4 for a discussion of utilities excluded from this group. E.8.1 c89 - Compile Standard C programs E.8.2 lex - Generate programs for lexical tasks E.8.3 yacc - Yet another compiler compiler BEGIN_RATIONALE E.9 C Language Bindings Option _E_d_i_t_o_r'_s _N_o_t_e: _T_h_e _t_e_x_t _o_f _t_h_e _R_a_t_i_o_n_a_l_e _f_o_r _t_h_i_s _s_e_c_t_i_o_n _h_a_s _b_e_e_n _t_e_m_p_o_r_a_r_i_l_y _l_o_c_a_t_e_d _i_n _A_n_n_e_x _B, _a_d_j_a_c_e_n_t _t_o _t_h_e _t_e_x_t _i_t _i_s _e_x_p_l_a_i_n_i_n_g. _T_h_e _t_e_x_t _w_i_l_l _r_e_t_u_r_n _t_o _t_h_i_s _a_n_n_e_x _a_f_t_e_r _t_h_e _c_o_m_p_l_e_t_i_o_n _o_f _b_a_l_l_o_t_i_n_g. E.9.1 C Language Definitions E.9.2 C Numerical Limits E.9.3 C Binding for Shell Command Interface E.9.4 C Binding for Access Environment Variables E.9.5 C Binding for Regular Expression Matching E.9.6 C Binding for Match Filename or Pathname E.9.7 C Binding for Command Option Parsing E.9.8 C Binding for Generate Pathnames Matching a Pattern Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. E.9 C Language Bindings Option 995 P1003.2/D11.2 E.9.9 C Binding for Perform Word Expansions E.9.10 C Binding for Get POSIX Configurable Variables E.9.11 C Binding for Locale Control BEGIN_RATIONALE E.10 FORTRAN Development and Runtime Utilities Options _E_d_i_t_o_r'_s _N_o_t_e: _T_h_e _t_e_x_t _o_f _t_h_e _R_a_t_i_o_n_a_l_e _f_o_r _t_h_i_s _s_e_c_t_i_o_n _h_a_s _b_e_e_n _t_e_m_p_o_r_a_r_i_l_y _l_o_c_a_t_e_d _i_n _A_n_n_e_x _C, _a_d_j_a_c_e_n_t _t_o _t_h_e _t_e_x_t _i_t _i_s _e_x_p_l_a_i_n_i_n_g. _T_h_e _t_e_x_t _w_i_l_l _r_e_t_u_r_n _t_o _t_h_i_s _a_n_n_e_x _a_f_t_e_r _t_h_e _c_o_m_p_l_e_t_i_o_n _o_f _b_a_l_l_o_t_i_n_g. This is the third and fourth of the optional utility environments. See section E.4 for a discussion of utilities excluded from this group. E.10.1 asa - Interpret carriage control characters E.10.2 fort77 - FORTRAN compiler END_RATIONALE Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 996 E Rationale and Notes P1003.2/D11.2 Annex F (informative) Sample National Profile BEGIN_RATIONALE BEGIN_RATIONALE _E_d_i_t_o_r'_s _N_o_t_e: _A_l_l _u_s_e_s _o_f _t_h_e _t_e_r_m ``_c_h_a_r_a_c_t_e_r _s_e_t'' _t_h_i_s _a_n_n_e_x _h_a_v_e _1 _b_e_e_n _c_h_a_n_g_e_d _t_o ``_c_o_d_e_d _c_h_a_r_a_c_t_e_r _s_e_t'' _w_i_t_h_o_u_t _f_u_r_t_h_e_r _d_i_f_f _m_a_r_k_s. _1 This annex is an example of a country's needs with respect to this standard and how those needs relate to other international standards as well as national standards. The example provided is included here for informative purposes and is not a formal standard in the country in question. It is provided by the Danish Standards Association1) and is as accurate as possible with regards to Danish needs. __________ 1) Further information may be obtained from the Danish Standards Association, Attn: S142u22A8 Baunegaardsvej 73, DK-2900 Hellerup, 2 Denmark; FAX: +45 39 77 02 02; Email: u22a8@dkuug.dk 2 The data is also available electronically by anonymous FTP or FTAM at the site dkuug.dk in the directory i18n, where some other example national profiles, locales, and _c_h_a_r_m_a_p_s may also be found. They are also available by an archive server reached at archive@dkuug.dk; use ``Subject: help'' for further information. Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. Annex F Sample National Profile 997 P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX F.1 (Example) Danish National Profile 2 This is the definition of the Danish Standards Association POSIX.2 2 profile. The subset of conforming implementations that provide the 2 required characteristics below is referred to as conforming to the 2 ``Danish Standards Association (DS) Environment Profile'' for this 2 standard. 2 This profile specifies the following requirements on implementations: 2 (1) In POSIX.2 section 2.13.1, the limit {COLL_WEIGHTS_MAX} shall be 2 provided with a value of 4. All other limits shall conform to 2 at least the minimum values shown in Table 2-16. 2 (2) The following options shall be supported according to POSIX.2 2 section 2.13.2: 2 POSIX2_C_BIND Optional. 2 POSIX2_C_DEV Optional. 2 POSIX2_FORT_DEV Optional. 2 POSIX2_FORT_RUN Optional. 2 POSIX2_LOCALEDEF Required; the system shall support the 2 creation of locales as described in 2 4.35. 2 POSIX2_SW_DEV Optional. 2 F.1.1 Danish Locale Model _E_d_i_t_o_r'_s _N_o_t_e: _T_h_i_s _s_u_b_c_l_a_u_s_e _i_s _o_f_f_e_r_e_d _a_s _r_a_t_i_o_n_a_l_e _f_o_r _t_h_e _c_u_r_r_e_n_t _s_t_a_t_e _o_f _t_h_i_s _e_x_a_m_p_l_e _a_n_n_e_x. _I_t _w_i_l_l _n_o_t _n_e_c_e_s_s_a_r_i_l_y _a_p_p_e_a_r _i_n _t_h_i_s _f_o_r_m _i_n _a_n_y _f_i_n_a_l _v_e_r_s_i_o_n _o_f _t_h_e _a_n_n_e_x. Creating a national locale for Denmark has been a quite elaborate effort. Time and again, we thought we had reached an agreement on the locale, but then some aspect disrupted the entire work, and we more or less had to start all over. We think we have identified the cause of these problems to a general uncertainty regarding the exact purpose of a ``national'' locale. If we look at the Danish situation (which we know pretty well by now), we have identified several levels of locales, depending on the ``complexity'' of the collating sequence (or more generally sorting different kinds of text): Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 998 F Sample National Profile Part 2: SHELL AND UTILITIES P1003.2/D11.2 (1) _B_y_t_e/_m_a_c_h_i_n_e _l_e_v_e_l. Here everything is sorted according to the character's byte value. (2) _C_h_a_r_a_c_t_e_r/_u_t_i_l_i_t_y _l_e_v_e_l. Here we want to work almost on the same level as (1), i.e., character by character, but obeying a (simple) collating sequence that ensures that, for example, upper- and lowercase letters are equivalent, or that national characters are sorted correctly. The characters still do not have any ``implicit'' meaning, and the comparison of two strings is still deterministic; i.e., strings that are different at level 1 are still different at level 2. (3) _T_e_x_t/_a_p_p_l_i_c_a_t_i_o_n _l_e_v_e_l. Here we want to be able to search in text looking for specific words or items. The comparison is still performed on a character-by-character basis, but possibly ignoring some characters that are not important, and determinism is not important either. (4) _S_e_m_a_n_t_i_c/_d_i_c_t_i_o_n_a_r_y/_l_i_b_r_a_r_y/_p_h_o_n_e-_b_o_o_k _l_e_v_e_l. Entire words like ``the'' are omitted from comparisons; maybe soundex is required. This probably requires specially developed software. Our problem has been the conflicting requirements from each of these levels, which we optimistically have tried to combine into a single national locale (ignoring level 4, however). The POSIX Locale is aimed at level 2; i.e., at a rather low level. Many of our attempts to write a national Danish locale have failed because we have actually tried to write a level 3 locale, and finding that it did not work as an alternative to the default POSIX locale at level 2. The locale we now provide is the final compromise between level 2 and level 3, by taking our latest attempt aimed at level 3, and make the comparison completely deterministic, and thus bring it down to level 2. We also have found that we may need to include some more information in the identification of a specific locale than just the country code, the language code, and the coded character set, since what we have had most problems with was the purpose or scope of a specific locale; i.e., is it just a nationalized version of the POSIX Locale (e.g., extended with , , and at the proper positions), is it aimed at text search (ignoring certain characters), or is it on an even higher level? Many such alternative locales would certainly be useful for various classes of problems or applications, so our model for the locale name identification string includes a <_v_e_r_s_i_o_n> parameter. We hope by providing these comments to have clarified our intention with the locale definitions to save other countries from doing our mistakes all over. Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. F.1 (Example) Danish National Profile 999 P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX F.2 Locale String Definition Guideline The following guideline is used for specifying the locale identification string:2) "%2.2s_%2.2s.%s,%s", <_l_a_n_g_u_a_g_e>, <_t_e_r_r_i_t_o_r_y>, <_c_o_d_e_d-_c_h_a_r_a_c_t_e_r- _s_e_t>, <_v_e_r_s_i_o_n> where <_l_a_n_g_u_a_g_e> shall be taken from ISO 639 {B1} and <_t_e_r_r_i_t_o_r_y> shall be the two-letter country code of ISO 3166 {B4}, if possible. The <_l_a_n_g_u_a_g_e> shall be specified with lowercase letters only, and the <_t_e_r_r_i_t_o_r_y> shall be specified in uppercase letters only. An optional <_c_o_d_e_d-_c_h_a_r_a_c_t_e_r-_s_e_t> specification may follow after a for the name of the coded character set; if just a numeric specification is present, this shall represent the number of the international standard describing the coded character set. If the <_c_o_d_e_d-_c_h_a_r_a_c_t_e_r-_s_e_t> specification is not present, the encoded character-set-specific locale shall be determined by the CHARSET environment variable, and if this is unset or null, the encoding of ISO 8859-1 {5} shall be assumed. A parameter specifying a <_v_e_r_s_i_o_n> of the locale may be placed after the optional <_c_o_d_e_d-_c_h_a_r_a_c_t_e_r-_s_e_t> specification, delimited by . This may be used to discriminate between different cultural needs; for instance, dictionary order versus a more systems-oriented collating order. F.3 Scope of Danish National Locale This national locale covers the Danish language in Denmark. In addition, Faroese and Greenlandic LC_TIME and LC_MESSAGES specifications have been defined; the rest of the Danish national locale shall be used for these locales as well. This locale is designed to be coded character-set independent. It completely specifies the behavior of systems based on ISO/IEC 10646 {B11} (with ISO 6429 {B5} control character encoding) together with many 7-bit and 8-bit encoded character sets, including ISO 8859 character sets and major vendor-specific 8-bit character sets (with ISO 6429 {B5} or ISO/IEC 646 {1} control character encoding when applicable). This locale is portable as long as the character naming in the charmap description file ISO_10646 for ISO/IEC 10646 {B11} is followed. Examples of such charmap files for ISO/IEC 10646 {B11} and ISO 8859-1 {5} are shown in F.5.1 and F.5.2. Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 1000 F Sample National Profile