From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1044c2,fb87ccfc9e8baf0a X-Google-Attributes: gid1044c2,public X-Google-Thread: 1103af,fb87ccfc9e8baf0a X-Google-Attributes: gid1103af,public X-Google-Thread: f66ab,fb87ccfc9e8baf0a X-Google-Attributes: gidf66ab,public X-Google-Thread: f678f,fb87ccfc9e8baf0a X-Google-Attributes: gidf678f,public X-Google-Thread: f71eb,fb87ccfc9e8baf0a X-Google-Attributes: gidf71eb,public X-Google-ArrivalTime: 1995-01-10 11:13:17 PST Path: nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!newsfeed.pitt.edu!gatech!europa.eng.gtefsd.com!portal.gmu.edu!osf1.gmu.edu!scoile From: scoile@osf1.gmu.edu (Steve "Stevers!" Coile) Newsgroups: comp.os.linux.misc,comp.os.os2.misc,comp.unix.osf.misc,comp.os.msdos.misc,comp.os.mach Subject: Re: The big Question Followup-To: comp.os.linux.misc,comp.os.os2.misc,comp.unix.osf.misc,comp.os.msdos.misc,comp.os.mach Date: 10 Jan 1995 19:13:17 GMT Organization: George Mason University, Fairfax, Virginia, USA Distribution: world Message-ID: <3eum8d$5st@portal.gmu.edu> References: <3dpmo9$6fh@calvin.st-and.ac.uk> <3dupdf$7i4@hpscit.sc.hp.com> <3dvd4u$rmv@usenet.INS.CWRU.Edu> <1995Jan2.135536.27035@imec.be> <1995Jan4.051639.24693@prpa.philips.com> <3ei3o8$n8r@portal.gmu.edu> <3erum9$7dl@omega.gmd.de> NNTP-Posting-Host: osf1.gmu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Newsreader: TIN [version 1.2 PL2] Xref: nntp.gmd.de comp.os.linux.misc:38000 comp.os.os2.misc:126638 comp.unix.osf.misc:2321 comp.os.msdos.misc:28680 comp.os.mach:3497 Holger Veit (veit@borneo.gmd.de) wrote: [...] >Normally you wouldn't see a command line buffer at all, How can you not see a command line buffer. *Every* command shell in existance buffers the command line. There *has* to be a buffer, else where would the input be stored?! > and if so, a real >operating system would have allocated it and passed it to the process. >The DOS way is quite close to the old CP/M way of having 126 bytes of >command line at 0x0080. It is the merit of C library implementations of It's still there, and it doesn't grow dynamically. The maximum length of most Unix command line buffers is, what 1K? Sure, you don't reach that limit often, but it's there! Additionally, there's no reason a command shell couldn't allocate *less* memory either. There's nothing that prohibits a 128 byte buffer, except practicality. > It is the merit of C library implementations of ^^^^^^^^^^^^^^^^^^^^^^^^^ >the c0.obj startup code that the command line gets split into the >argc/argv arguments. Note! C libraries handle the splitting of the command line into argv and argc. Unix doesn't do it inherently?! Oh my! Guess that would explain why argv and argc are available to DOS C programmers, huh? > As argc is an int, I don't worry whether the value >of it is 20 or 20000, as my program would not look different if it has to >process 20 files or 20000 in sequence. Your program isn't going to look any different the way DOS does it, either. What's your point? > Argv, BTW, is usually allocated >on the stack, so it may be as long as stack size permits (with 16 bit dumb >DOS, it could have been 64K in theory before awfully f*cking around with >segments), Yes, you have to deal with segments, but that's a limitation of the Intel architecture. Any Intel-based Unix has to deal with it too (although, presumably, most hide it from the programmer). > but allocating a static buffer was obviously much more simple >for the DOS developers, You're confusing the command buffer with argv and argc, me thinks. According to you, argv and argc are allocated dynamically, presumably at program execution. The same can be and is done for DOS C programs as well. > and not providing reasonable OS or library support >for wildcard expansion Ummmm...aren't there, like, FIND_FILE() and FIND_NEXT() routines within the set of DOS system calls? Did you, perhaps, forget about those? > (or one even does not dare to think about it, in >the command line interpreter *) Depends on what you want and why. Besides, you could always replace COMMAND.COM with a command interpreter that expanded wildcards, but that'd screw up a whole bunch of other programs. > has caused the mix of programs that expand >their arguments, don't do that, want to have their options in a non-intuitive >sequence (like 'copy/b foo bar' won't do, but 'copy foo bar/b' will - >or vice versa, don't nail me down on this, I use trial and error there), Some "Unix" commands don't allow wildcards or multiple files either. That's a non-issue. As for the "non-intuitive sequence", I suggest you read up on your Unix commands. A great many, such as ls, cp, rm, mv, vi, and so on, require that flags, switches, qualifiers, or whatever you want to call them, come before the file specifications. Try reading the man pages for some of those commands--you might learn something. >programs that mix command line arguments and direct input via gets >- just the heterogeneous style a 1st semester student uses to write the first >program. "Mix command line arguments"? What does that mean? >In earlier versions of DOS, there was an undocumented (yet another topic: >Microsoft made undocumented features a real science - something you don't >find in Unix (you probably won't find the right man page right now)) feature >named switchar, allowing to toggle the option symbol from '/' to '-' >(as God(tm) meant it to be ;-)) Every operating system in existance has undocumented functionality. What's your point? -Steve Coile