X/Open Guide
Total Page:16
File Type:pdf, Size:1020Kb
X/Open Guide XPG3-XPG4 Base Migration Guide, Version 2 X/Open Company Ltd. December 1995, X/Open Company Limited All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the copyright owners. X/Open Guide XPG3-XPG4 Base Migration Guide, Version 2 ISBN: 1-85912-156-X X/Open Document Number: G501 Published by X/Open Company Ltd., U.K. Any comments relating to the material contained in this document may be submitted to X/Open at: X/Open Company Limited Apex Plaza Forbury Road Reading Berkshire, RG1 1AX United Kingdom or by Electronic Mail to: [email protected] ii X/Open Guide (1995) Contents Part 1 General Information ........................................................................ 1 Chapter 1 Introduction............................................................................................... 3 1.1 Objectives ..................................................................................................... 4 1.2 XSI Documentation — XPG3, XPG4 and the Single UNIX Specification ..................................................................................... 5 1.3 Conformance to Standards ....................................................................... 6 1.3.1 C Language in an Issue 4 Environment .............................................. 7 1.4 Portability ..................................................................................................... 8 1.5 Existing Shell Applications....................................................................... 9 1.6 Guidelines for Interactive Users.............................................................. 10 1.7 XPG4 Profiles ............................................................................................... 11 1.7.1 XPG4 Base Profile..................................................................................... 11 1.7.2 XPG4 Base 95 Profile ............................................................................... 11 1.7.3 XPG4 UNIX Profile.................................................................................. 11 Chapter 2 General Portability Issues ................................................................ 13 2.1 Glossary ........................................................................................................ 13 2.2 Internationalisation .................................................................................... 14 2.2.1 Bytes and Characters............................................................................... 14 2.2.2 Message Catalogues ................................................................................ 14 2.3 Character Set................................................................................................ 15 2.3.1 Character Set Description File............................................................... 15 2.3.2 Transparency............................................................................................. 15 2.3.3 Utilities and Multi-byte Codeset Support .......................................... 16 2.3.4 System Interfaces and Headers Multi-byte Codeset Support........ 16 2.4 Locale............................................................................................................. 18 2.4.1 Collation .................................................................................................... 19 2.4.2 Character Classification.......................................................................... 19 2.4.3 Date and Time Formatting..................................................................... 21 2.4.4 Numeric Formatting................................................................................ 21 2.4.5 Affirmative Responses............................................................................ 21 2.4.6 Message Formatting ................................................................................ 22 2.4.7 Monetary Formatting.............................................................................. 22 2.4.8 Functions that Invoke Commands....................................................... 22 2.5 Environment Variables .............................................................................. 23 2.5.1 Locale Environment Variables .............................................................. 24 2.5.2 Other Environment Variables................................................................ 25 2.6 Regular Expressions................................................................................... 26 2.7 Directory Structure and Devices ............................................................. 29 2.7.1 Directory Structure.................................................................................. 29 2.7.2 Output Devices and Terminal Types ................................................... 29 XPG3-XPG4 Base Migration Guide, Version 2 iii Contents 2.8 General Terminal Interface ....................................................................... 30 2.9 Invoking Commands ................................................................................. 31 2.9.1 Utility Syntax Guidelines....................................................................... 31 2.9.2 Limits.......................................................................................................... 32 2.9.3 Input/Output Formats ........................................................................... 33 2.9.4 Errors.......................................................................................................... 33 2.9.5 Other Global Utility Behaviour............................................................. 33 Part 2 Commands and Utilities Migration..................................... 35 Chapter 3 Shell Command Language ............................................................... 37 3.1 Naming Considerations ............................................................................ 37 3.1.1 Identifiers................................................................................................... 37 3.1.2 Operators................................................................................................... 37 3.1.3 Selecting Command Interpreters.......................................................... 38 3.1.4 Aliases........................................................................................................ 38 3.1.5 Reserved Command Names.................................................................. 38 3.2 Parameters, Variables and Word Expansions ....................................... 39 3.2.1 IFS................................................................................................................39 3.2.2 Tilde Expansion........................................................................................ 39 3.2.3 Parameter Expansion .............................................................................. 40 3.2.4 Command Substitution .......................................................................... 41 3.2.5 Arithmetic Expansion ............................................................................. 41 3.3 Redirection ................................................................................................... 42 3.4 Shell Commands ......................................................................................... 43 3.4.1 Command Search..................................................................................... 43 3.4.2 Pipelines and Lists ................................................................................... 44 3.5 Pattern Matching......................................................................................... 45 3.6 Special Built-ins........................................................................................... 46 3.6.1 dot ............................................................................................................... 46 3.6.2 exec ............................................................................................................. 46 3.6.3 exit...............................................................................................................46 3.6.4 export.......................................................................................................... 46 3.6.5 readonly..................................................................................................... 46 3.6.6 return.......................................................................................................... 46 3.6.7 set ................................................................................................................47 3.6.8 trap.............................................................................................................. 47 3.6.9 unset ........................................................................................................... 47 Chapter 4 Utilities......................................................................................................... 49 4.1 Introduction ................................................................................................. 49 4.1.1 Symbolic Link Support ........................................................................... 49 4.2 Utility Migration Information .................................................................. 50 iv X/Open Guide (1995) Contents Part