|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to make bash wrapper for java/groovy program with variable length arguments lists?
The following bash script does not work because the java/groovy code always thinks there are four arguments even if there are only 1 or 2. As you can see from my hideous backslashes, I am using cygwin bash on windows. Code:
export CLASSPATH=${GROOVY_HOME}\\embeddable\\groovy-all-1.7.4.jar\;c:\\Documents\ and\ Settings\\a-sheintze\\My\ Documents\\eclipse-workspace\\js\\grep\\src\\siegfried\\bin\;.
java siegfried.grep $1 $2 $3 $4How can I fix this problem with bash or some other shell? I would like to know how to fix this problem with cmd.exe but I fear this is the wrong forum for that! (If anyone knows, please let me know!) Thanks, siegfried Last edited by siegfried; 11-18-2010 at 02:27 PM.. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
The special variable
"$@" expands to all arguments, even when quoted like that. When not quoted, it might split on spaces in filenames, so keep it quoted just as shown.
|
| Sponsored Links | ||
|
![]() |
| Tags |
| argument list, bash, variable length |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to make 2 separate arguments in 1 bash script? | guitarscn | Shell Programming and Scripting | 4 | 08-31-2010 05:12 PM |
| Make variable length record a fixed length | jclanc8 | Shell Programming and Scripting | 3 | 10-03-2009 08:24 PM |
| Make a list in bash out of arguments | jolecanard | Shell Programming and Scripting | 4 | 07-02-2009 04:23 PM |
| using a variable from java program in unix | inquisitive101 | UNIX for Dummies Questions & Answers | 1 | 01-14-2009 08:24 AM |
|
|