Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!columbia!rutgers!ames!ucbcad!ucbvax!YALE.ARPA!LEICHTER-JERRY From: LEICHTER-JERRY@YALE.ARPA Newsgroups: comp.os.vms Subject: Re: Yet another bug in VMS C Message-ID: <8707291008.AA17919@ucbvax.Berkeley.EDU> Date: Wed, 29-Jul-87 06:08:28 EDT Article-I.D.: ucbvax.8707291008.AA17919 Posted: Wed Jul 29 06:08:28 1987 Date-Received: Fri, 31-Jul-87 02:21:29 EDT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Distribution: world Organization: The ARPA Internet Lines: 54 I have discovered truly bizarre behavior in C for VAX/VMS. The command-line arguments are folded to all lowercase. The only way of preserving case seems to be to enclose arguments in double quotes. Thus a command like tr a-z A-Z won't work. How does one tell it not to do it? I could find no references to this in the index of the VMS C manual. You didn't look in the index very hard, did you? It took me about 30 seconds to find the index entry "Main function, syntax of". A quick look at the single section that points to makes it clear that this is the place to find the details. Reading on, we find (page 11-31 in Programming in VAX C - the V2.0-V2.2 version): DCL converts most arguments on the command line to uppercase letters. However, VAX C internally parses and modifies the altered command line to make VAX C argument access compatible with C programs on other systems. All alphabetic arguments in the command line are delimited by spaces or tabs. Arguments that have embedded spaces or tabs must be enclosed in quotation marks (" "). Uppercase characters in arguments are converted to lowercase, but arguments within quotation marks are left unchanged. This is NOT a bug in C; in fact, it has as little to do with C as the fact that the Unix shells will interpret various metacharacters unless you quote them. There is no way to prevent DCL from forcing all the unquoted letters to upper case, and there is nothing VAX C can do to restore the original case - the information is simply not available to it. VAX C does the best it can by converting everything to lower case because (a) most Unix command options are lower case; (b) file specs on VMS don't distinguish case, so changing the case of file specs doesn't matter. Hence, most Unix program interfaces will work unchanged. tr happens to be a special case. (grep would be, too. But note that on VMS, unlike Unix, you don't have to use quotes to pass "*" when in regular expressions.) Now, repeat 10 times: I will not assume something isn't in the manual until I've looked. I will not assume something is a bug because I don't understand it. I will not assume something is a bug because it's not exactly like Unix. -- Jerry -------