Search found 6 matches

by flabdablet
23 Jul 2011 00:29
Forum: DOS Batch Forum
Topic: Passing double quote as a parameter
Replies: 7
Views: 18664

Re: Passing double quote as a parameter

Of course, if you don't mind maintaining a bunch of script files instead of just the one, you can simply put your sed scripts in their own files and call sed directly. fix-html-quote.sed: s/"/"/g fix-report.cmd: set bin=%ProgramFiles%\GnuWin32\bin set sed="%bin%\sed.exe" %sed...
by flabdablet
22 Jul 2011 12:01
Forum: DOS Batch Forum
Topic: Passing double quote as a parameter
Replies: 7
Views: 18664

Re: Passing double quote as a parameter

I've been playing with GnuWin32 sed on a test machine, and I think I've come up with a semi-reasonable way to integrate it with cmd scripts. The trouble with mixing sed and cmd is that sed scripts are full of cryptic punctuation characters and cmd has a totally toxic parser. Persuading cmd not to sc...
by flabdablet
21 Jul 2011 12:13
Forum: DOS Batch Forum
Topic: Passing double quote as a parameter
Replies: 7
Views: 18664

Re: Passing double quote as a parameter

Also: unless you have some really, really good reason for using a cmd script to do your scripted file editing, you'd be far better off just installing and using sed.

If you have a lot of XML to massage, you might also care to look into using Pyx as an intermediate format.
by flabdablet
21 Jul 2011 12:01
Forum: DOS Batch Forum
Topic: Passing double quote as a parameter
Replies: 7
Views: 18664

Re: Passing double quote as a parameter

Also, cmd doesn't do automatic quote removal. If you double-quote a string, the quotes become part of the string. Yes, this sucks. You can strip quotes from a script parameter by using %~1 where you would otherwise have used %1; this doesn't do anything bad to unquoted parameters. See help call for ...
by flabdablet
21 Jul 2011 11:55
Forum: DOS Batch Forum
Topic: Passing double quote as a parameter
Replies: 7
Views: 18664

Re: Passing double quote as a parameter

Try ^"

You use ^ in cmd pretty much the same way you'd use \ in sh.