preston@felix.UUCP (Preston Bannister) (11/23/87)
In article <1845@chinet.UUCP> dag@chinet.UUCP (Daniel A. Glasser) writes: >In article <13021@felix.UUCP> preston@felix.UUCP (Preston Bannister) writes: >>Has anyone out there implemented a version of the system() library >>routine that uses the Mark Williams/Beckmeyer scheme for passing long >>argument lists? >>Unfortunately, the system() routine in the Mark Williams library does >>not. The argument list gets truncated after 127 characters. >Not true! The Mark Williams library DOES use the environment scheme >for system()... It calls up the shell, msh.prg, and msh calls up the >command. If you are getting truncated command lines, something is >screwing around with the "ARGV" or "IOVECT" environment string and >the runtime startup is not finding the parameters in the environment. On further investigation, you're right...sort of. The problem, as it turns out, is that the Beckmeyer C-shell does not handle very long single arguments. The MWC system() passes through the string given to it as a single argument. I.e. the call: system("foo bar baz"); Becomes a call to the default shell with the following MWC extended argument list appended to the environment (assume the SHELL environment variable is set to 'shell.prg', the iovector is approximate): ARGV=CCCA?????????????????? shell.prg -c foo bar baz Note that the string passed to the system() call is passed through as a single argument. I had the SHELL environment variable set to 'csh.prg', the Beckmeyer C-shell. When csh was given a single argument longer than 127 characters, it truncates the argument. The shell supplied with MWC (msh) can handle single arguments that are longer than 127 characters. So where does this leave us? 1. Use 'msh' for the default shell in makefiles where the argument list may be longer than 127 characters. (I set the environment variable SHELL to 'msh.prg' at boot time with GEMBOOT). 2. The system() function should be fixed to spilt up the command string passed to it into an argument list. (My opinion). 3. The Beckmeyer C-shell (and other shells :-) should be prepared to handle single arguments longer than 127 characters. (My opinion). -- Preston L. Bannister USENET : ucbvax!trwrb!felix!preston BIX : plb CompuServe : 71350,3505 GEnie : p.bannister
juancho@dgp.toronto.edu.UUCP (11/26/87)
In article <13782@felix.UUCP> preston@felix.UUCP (Preston Bannister) writes: >So where does this leave us? > >1. Use 'msh' for the default shell in makefiles where the argument > list may be longer than 127 characters. (I set the environment > variable SHELL to 'msh.prg' at boot time with GEMBOOT). > >3. The Beckmeyer C-shell (and other shells :-) should be prepared to > handle single arguments longer than 127 characters. (My opinion). Flame ON Oh the wonder of a well thought out system! 'Why should any one need more that 127 characters in an argument string? Hard code it in boys.' DRI SOftware person. 'Why should we get a good operating system when we can buy this one from DRI. And look we can only pass 127 characters as arguments. Oh well Document it so that it becomes a feature and not a bug' Overheard in a Ferrari dealership Flame off A proposal for extended argument passing is floatting around Instead of forgetting about it lets adopt it. You ask how? This is how. First Atari will endorse it and fix their compilers so that they support it, then They will release free roms that fix this and other bugs, then all the software houses will adopt it. -- John W. Buchanan Dynamic Graphics Project Computer Systems Research Institute (416) 978-6619 University of Toronto
db@hoptoad.uucp (David Beckemeyer) (12/03/87)
Newsgroups: comp.sys.atari.st Subject: Re: Beckmeyer C-shell bug (was: Source for a system() routine needed) Summary: Expires: References: <13021@felix.UUCP> <1845@chinet.UUCP> <13782@felix.UUCP> Sender: Reply-To: db@hoptoad.UUCP (David Beckemeyer) Followup-To: Distribution: Organization: Nebula Consultants in San Francisco Keywords: In article <13782@felix.UUCP> preston@felix.UUCP (Preston Bannister) writes: >In article <1845@chinet.UUCP> dag@chinet.UUCP (Daniel A. Glasser) writes: > >On further investigation, you're right...sort of. The problem, as it >turns out, is that the Beckmeyer C-shell does not handle very long >single arguments. > >The MWC system() passes through the string given to it as a single >argument. I.e. the call: > > system("foo bar baz"); > >Becomes a call to the default shell with the following MWC extended >argument list appended to the environment (assume the SHELL environment >variable is set to 'shell.prg', the iovector is approximate): > > ARGV=CCCA?????????????????? > shell.prg > -c > foo bar baz > >Note that the string passed to the system() call is passed through as >a single argument. > >I had the SHELL environment variable set to 'csh.prg', the Beckmeyer >C-shell. When csh was given a single argument longer than 127 >characters, it truncates the argument. > >The shell supplied with MWC (msh) can handle single arguments that are >longer than 127 characters. Thanks for brining this to my attention. I was not aware that Micro C-Shell did not handle individual arguments longer than 127 chars. I'll look it, and if after further investigation I find that this is indeed the case, I will fix it. David Beckemeyer Beckemeyer Development Tools ...ihnp4!hoptoad!bdt!david