Date: Wed, 1 Apr 1998 18:00:57 -0800 (PST) Message-Id: <199804020200.SAA18650@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Eli Zaretskii , djgpp-workers AT delorie DOT com From: Nate Eldredge Subject: Re: Quoting in [4N]DOS Precedence: bulk At 07:52 4/1/1998 +0300, Eli Zaretskii wrote: >A number of GNU projects need to quote arguments passed to sub-processes >so that these arguments are parsed correctly on the child side. While >looking at the multitude of possible cases, I've stumbled across 4DOS and >its ilk, and I'm totally stumped. > >Would people who use 4DOS please explain me in small words how should I >go about quoting the ` (grave accent) character? I have read the 4DOS >manual from top to bottom, and tried several ways, but it seems like >impossible! I did find a way to quote " (use `, like in `foo"bar`), but >no such luck with ` itself. No matter what I tried, I got complaints >about unbalanced `. What did I miss? You have to quote ` with the Control-X character. It documents doing this from the command prompt, although not in a good place in the manual. You just hit Ctrl-X. It doesn't talk about it otherwise, but it works when in a non-interactive shell as well. Control-X is hex 0x18. So this works: system("4dos /c gecho \x18`"); It is horribly ugly. This is one thing I hate about 4DOS; its attempt to implement Unix shell-like features without the quoting and so forth that needs to go with it. However, for most things, it is significantly more convenient to use than COMMAND.COM, while being more DOS-ish than bash. For me, anyway. Nate Eldredge eldredge AT ap DOT net