For example, foo -option 10->30 file.ext
(this is an actual syntax required) redirects the output to a file named 30. How do I make cmd understand that I would like to pass the actual > character? I've tried several forms of double quotes to no avail.
Asked
Active
Viewed 3,515 times
8

MaxVT
- 183
- 1
- 5
3 Answers
11
The cmd escape character is ^
so:
foo -option 10-^>30 file.ext
should work for you

MattB
- 11,194
- 1
- 30
- 36
-
I never would have known/guessed that - I still can't believe that someone is writing windows software the requires a reserved character. – mfinni Mar 26 '10 at 15:12
-
1@mfinni: I often use the caret as escape in a FOR loop containing pipe(s). Long live batch! :) – jscott Mar 26 '10 at 16:26
-
2@jscott - lets not start that craziness :) Powershell to the rescue. – MattB Mar 26 '10 at 18:35
-
@mfinni: It's perfectly normal in most other places (such as Linuxland). – user1686 Mar 26 '10 at 20:19
-
@grawity - that's why I specified "windows software". I know that when you're doing stuff in shell/batch or via pipes or other weird-ish environments, even in windows, you have to escape a lot of things. But he just said he's using cmd - I never would have thought someone would purposefully write something that guaranteed wouldn't work from cmd. – mfinni Mar 26 '10 at 21:07
-
@mfinni But it does. You just need to escape it as usual. – user1686 Mar 27 '10 at 19:06
-
@grawity It's a tool ported from Linuxland, so they may not be aware of other operating systems' limitations... or aware, but not particularly interested in accommodating Windows users. – MaxVT Apr 23 '10 at 18:12
0
Ask the vendor for the foo
command how it's supposed to work?

mfinni
- 36,144
- 4
- 53
- 86
-
−1. That's the shell and not the program doing something with the `>` here. – Joey Mar 27 '10 at 11:43
-
I understand that - I simply don't see a competent vendor writing software for windows with syntax that *won't work out of the box* on the default shell. Not sure the -1 is necessary. – mfinni Mar 27 '10 at 15:40