Bug #5097
closed
kepler.sh accepts a limited number of arguments
Added by Derik Barseghian over 14 years ago.
Updated over 14 years ago.
Category:
execution engine
Description
kepler.sh accepts a limited number of arguments:
java -classpath build-area/lib/ant.jar:kepler.jar org.kepler.build.runner.Kepler "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
If you attempt to give more, you'll get compilation errors that are misleading. A user ran into this problem:
http://mercury.nceas.ucsb.edu/kepler/pipermail/kepler-users/2010-July/002249.html
Changing the line to accept more works fine:
java -classpath build-area/lib/ant.jar:kepler.jar org.kepler.build.runner.Kepler "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" "${10}" "${11}"
Are we going to keep this script, or move to an ant task? If we're keeping the script, and there's no solution to accept unlimited arguments, we should at the very least accept some very large number of arguments, and print an error message if the user attempts to feed in more.
Under /bin/sh in $PTII/bin/ptinvoke.in, we use "shift" to remove script specific
arguments and then use ${1+"$@"} to pass all but the first argument
to the Java subprocess.
The arguments in kepler.sh were enumerated separately to handle arguments containing spaces. Any solution to this bug should still support arguments containing spaces.
It is now fixed by changing bash and bat to:
kepler.sh:
java -classpath build-area/lib/ant.jar:kepler.jar org.kepler.build.runner.Kepler "$@"
kepler.bat:
java -classpath build-area\lib\ant.jar;kepler.jar org.kepler.build.runner.Kepler %*
The workflow execution command I tried is as follows:
D:\Kepler\repository\testtrunk>kepler.bat -runwf -nogui -Str1 2 -Str2 2 -Str3 2 -Str8 2 -Str9 10 "c:\Users\jianwu\KeplerData\Kepler-2.0-Demos\demos\getting-started\04-HelloWorld NoGUI WithParas.kar"
Original Bugzilla ID was 5097
Also available in: Atom
PDF