Path: utzoo!censor!geac!maccs!cs4g6ag From: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc Subject: Re: Why is comma delimiter in batch files? Keywords: batch MSDOS Message-ID: <25A26664.27618@maccs.dcss.mcmaster.ca> Date: 3 Jan 90 20:53:56 GMT References: <3445@cbnewsl.ATT.COM> Reply-To: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Organization: McMaster University, Hamilton, Ontario Lines: 29 In article <3445@cbnewsl.ATT.COM> rl@cbnewsl.ATT.COM (roger.h.levy) writes: $My question: Is there a way to convince batch files to think of the comma $as part of the parameter, i.e. to regard only blanks as delimiters so as $to be consistent with c programs? Well, on the command line you can surround strings with quotes and that will cause any special characters in them to be treated as normal characters instead (e.g. you can type echo "Three is greater than two: 3>2" and DOS will respond with "Three is greater than two: 3>2" or at least it will on my generic MS-DOS 3.20) and I would imagine that this will remove the special connotation from the comma. The reason why your C program and the batch file respond differently is due to what it is that parses the input string. For the batch file, the string is parsed by COMMAND.COM using its idea of what a delimiter is. For the C program, the parsing is done by the C0.OBJ code using its idea of what a delimiter is (the command tail passed to the C program is passed straight to the program with the exception of redirection being removed so that it's transparent to the program). If the two don't agree, you can have problems such as you show in your original article. -- Stephen M. Dunn cs4g6ag@maccs.dcss.mcmaster.ca = "\nI'm only an undergraduate!!!\n"; **************************************************************************** If it's true that love is only a game//Well, then I can play pretend