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 7.1.2 Pipe Communications with Programs Any language binding to Language-Independent System Services shall include a facility to execute a shell command, and to write the standard input or read the standard output of that command via a pipe. The language-independent specification for this facility has not been developed. The C binding for this facility is the _p_o_p_e_n() and _p_c_l_o_s_e() functions described in B.3.2. 7.2 Access Environment Variables Any language binding to Language-Independent System Services shall include a facility to obtain values of environment variables, as specified in POSIX.1 {8}. The language-independent specification for this facility has not been developed. The C binding for this facility is the _g_e_t_e_n_v() function described in POSIX.1 {8} 4.6.1. BEGIN_RATIONALE 7.2.1 Access Environment Variables Rationale. (_T_h_i_s _s_u_b_c_l_a_u_s_e _i_s _n_o_t _a _p_a_r_t _o_f _P_1_0_0_3._2) This facility is required in POSIX.2 so that applications can obtain values of exported shell variables. END_RATIONALE 7.3 Regular Expression Matching Any language binding to Language-Independent System Services shall include a facility to interpret regular expressions as described in 2.8. The language-independent specification for this facility has not been developed. The C binding is the _r_e_g_c_o_m_p(), _r_e_g_e_x_e_c(), and _r_e_g_f_r_e_e() functions described in B.5. BEGIN_RATIONALE Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 7.3 Regular Expression Matching 849 P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX 7.3.1 Regular Expression Matching Rationale. (_T_h_i_s _s_u_b_c_l_a_u_s_e _i_s _n_o_t _a _p_a_r_t _o_f _P_1_0_0_3._2) This service is important enough that it should be required by any language binding to POSIX.2. Regular expression parsing and pattern matching are listed separately, since they are different services. A language binding could provide different functions to support regular expressions and patterns, or could combine them into a single function. END_RATIONALE 7.4 Pattern Matching Any language binding to Language-Independent System Services shall include a facility to interpret patterns as described in 3.13.1 and 3.13.2. This facility shall allow the application to specify whether a slash character in the string to be matched will be treated as a regular character, or must be explicitly matched against a slash in the pattern. The language-independent specification for this facility has not been developed. The C binding is the _f_n_m_a_t_c_h() function described in B.6. 7.5 Command Option Parsing Any language binding to Language-Independent System Services shall include a facility to parse the options and operands from the command line that invoked the application. The language-independent specification for this facility has not been developed. The C binding for this facility is the _g_e_t_o_p_t() function described in B.7. 7.6 Generate Pathnames Matching a Pattern Any language binding to Language-Independent System Services shall include a facility to generate pathnames matching a pattern as described in 3.13. The language-independent specifications for this facility has not been developed. The C binding is the _g_l_o_b() and _g_l_o_b_f_r_e_e() functions described in B.8. Copyright c 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 850 7 Language-Independent System Services