Ranchers, When I execute the java program (described in a shell)in linux machine with white-space contained argument, the prgram received more arguments than expect, but I have already enclose the argument using double quote.
I use the command like this
deploy.sh "argu ment 1".
but the program prompt it receive 3 argument than 1.
in deploy.sh
#!/bin/sh
. ./set_classpath.sh
date >> ../../logs/cif_deployment.out date >> ../../logs/cif_deployment.err
SCJP 1.4<br />SCWCD 1.3<br />SCJD<br />SCBCD<br />IBM Xml Cert in progress
Wirianto Djunaidi
Ranch Hand
Joined: Mar 20, 2001
Posts: 195
posted
0
The problem is caused by the shell script stripped off your double quote. To make it work you have to put the double quote inside your script when calling the java class.
The weakness of above script is it will wrapped all your arguments into one, or you can code it like before
If you are VERY SURE there will always be 3 arguments, because is you do not pass enough arguments..the double quotes in the above script will pass empty string to your java program as argument...so your java program will always have 3 arguments.