commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Fooks" <afo...@allot.com>
Subject RE: simple Java problem - please, help
Date Mon, 23 Feb 2009 08:48:44 GMT
Hello, All,

 

My application received parameters from the Java command line.

 

Some of parameter names have spaces inside.

In W2K I use quotation marks and it works.

In Linux (Red Hat) the same command line doesn't work:

 

./run1.sh -add -service -name serviceNew -application "Other TCP"
-service_type PRIMARY -add_port TCP:DEFAULT:555

=====================Input:

[-add]

[-service]

[-name]

[serviceNew]

[-application]

[Other]

[TCP]

[-add_port]

[TCP:DEFAULT:555] 

 

run1.bat -add -service -name serviceNew -application "Other TCP"
-service_type PRIMARY -add_port TCP:DEFAULT:555

=====================Input:

[-add]

[-service]

[-name]

[serviceNew]

[-application]

[Other TCP]

[-service_type]

[PRIMARY]

[-add_port]

[TCP:DEFAULT:555]

=====================End Input:

 

This is run script on W2K:

java -cp .;./lib/commons-cli-1.0.jar cli.TestCli %*

 

This is script on Linux:

java   -cp  .:./lib/commons-cli-1.1.jar cli.TestCli $*

 

It's clear that Java VM does this wrong parsing of command line before
of using commonCli.

 

Could anybody help me?

 

 

Best Regards

 

Alex Fooks

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message