I write this little program to figure out how the command line
processor interferes with parameters.
"/dp/([0-9A-Z]+)(/ref=[0-9a-z_]+)?\">Kindle"
package com.mindprod.example;
import static java.lang.System.out;
/**
* Tool to learn how the command processor interferes with parameters
passed.
* <p/>
* composed with IntelliJ IDEA
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0 - 2008-06-08
*/
public final class TestParms
{
// --------------------------- main() method
---------------------------
/**
* Collect and display the parameters.
*
* @param args anything.
*/
public static void main( String[] args )
{
out.println( args.length + " parameter" + ( args.length == 1 ?
"" : "s" ) );
for ( String arg : args )
{
out.println( "{" + arg + "}" );
}
out.println( "--done--" );
}
}
If I type
java com.mindprod.example.TestParms ">abc"
It outputs
1 parameter
{>abc}
--done--
it taken as an ordinary character.
But if I put something more complicated like:
java com.mindprod.example.TestParms
"/dp/([0-9A-Z]+)(/ref=[0-9a-z_]+)?\"\>K
indle"
Then there is no output because the > is treated as a redirection.
I am using Vista with TakeCommand.
--
Roedy Green Canadian Mind Products
The Java Glossaryhttp://mindprod.com
Good observation.
It's because it's not of Java. It how OS works with command line
parameters. It could be any language or application - result will be
the same.
Alex.