From: David A. <da...@us...> - 2005-10-18 20:07:01
|
Proposed ooRexx for Unix/Linux Changes Currently there is a major difference between the Windows and Unix version of ooRexx concerning the way that the command line is handled. On Windows, ooRexx uses a Windows API to obtain the command line arguments as a string which is then stored for use by the script as the arg(1) value. ooRexx does no parsing of this string and passes it intact for use. On Unix, the command line is not available via a system API and the command line must be reconstructed from the formal C argc and argv standard arguments supplied to the C main procedure. The problem is that ooRexx does not reconstruct the command line properly i.e. any surrounding double quotes for any arguments are not included in the command line reconstruction. This causes a portability problem between the command line parsing behaviour of scripts on Windows and Unix. The ooRexx development team proposes to fix this problem in the next release so that the Unix versions of ooRexx reconstructs the command line as closely as possible to what the user actually typed. Reconstruction cannot be 100% as there will be no way to determine the number of blanks between some arguments. But we propose to at least perform the following actions during the reconstruction of the command line: 1. If a C argv argument contains embedded blanks it will be reconstructed with surrounding double quotes. 2. If a C argv argument contains a double quote an escape character will be inserted in front of the double quote. The escape character will be a backslash ('\') character. 3. If a C argv argument contains a backslash an escape character will be inserted in front of the backslash. The escape character will be a backslash ('\') character. 4. The final command line will contain one space character between all of the arguments. The steps listed above should provide a command line to the Unix ooRexx script that is at least 98% compatible with what is provided in Windows thus increasing the portability of scripts to and from Windows and Unix. Please note that we are not proposing any changes to the way that ooRexx handles the command line on Windows. This proposal only concerns the Unix versions of ooRexx. The ooRexx development team is soliciting your feedback on this proposal. You can reply to the oorexx-devel mailing list or directly to myself. Suggestions, improvements, etc. are all welcome. Thanks, W. David Ashley IBM Linux Technology Center OpenHPI and Open Object Rexx Team Home Office: 512-246-9106 Mobile Phone: 512-289-7506 IBM Phone: 512-838-0609 T/L 678-0609 Intranet: David Ashley/Austin/IBM@IBMUS Internet: da...@us... Alternate Internet: da...@ho... |