Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site digi-g.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!stolaf!umn-cs!digi-g!dan From: dan@digi-g.UUCP (Dan Messinger) Newsgroups: net.micro.pc Subject: Re: conventions regarding quoted arguments to DOS commands Message-ID: <646@digi-g.UUCP> Date: Thu, 6-Jun-85 09:43:54 EDT Article-I.D.: digi-g.646 Posted: Thu Jun 6 09:43:54 1985 Date-Received: Fri, 7-Jun-85 03:27:51 EDT References: <715@pyuxqq.UUCP> Reply-To: dan@digi-g.UUCP (dan) Organization: Digigraphic Systems Corp., Mpls, MN Lines: 35 Summary: In article <715@pyuxqq.UUCP> ral@pyuxqq.UUCP (R A Levenberg) writes: >the UNIX shell will parse this command line > sed 's/x/ /g' into 2 arguments, > sed > s/x/ /g >The sed command never knows that quotes were used to define the >argument. The same does not seem to be true in DOS, where I think >the above command would produce these arguments > sed > 's/x/ > /g' >How, then, does one pass an argument containing delimiters such >as blanks to a DOS command (especially a UNIX command ported to a PC)? DOS does not parse parameters at all. It is up to the application to do it. It is code that is added by the C compiler that is doing the parsing before calling main() of the application. So it is up to the C compiler to recognize quotes. Your above example works fine under DOS if you use the MS version 3 C with "...". It doesn't recognize '...'. Also, "s will prevent DOS from acting on <, > and |. >A related question is the evalution of, say, *.c, on a command line. >DOS (actually command.com) will tell the invoked program its argument >is "*.c", whereas the UNIX shell will tell the invoked program its arguments >are, say, main.c, foo.c and bar.c. Does this mean that DOS programs >use those SYSINT system calls themselves to get first matching file name >and next matching file name whenever an argument contains wild card >characters? Afraid so. I heard a rumor once that the MS ver 3 C would expand match characters. I've tried it, and it doesn't. Dan Messinger ihnp4!umn-cs!digi-g!dan