Sponsored Content
Top Forums Shell Programming and Scripting How to make bash wrapper for java/groovy program with variable length arguments lists? Post 302472933 by siegfried on Thursday 18th of November 2010 01:42:34 PM
Old 11-18-2010
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 $4

How 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 03:27 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using a variable from java program in unix

Hi, I need to execute a java program in a shell script.I then need to assign the value being returned by the program into a unix variable.Is there any way i can access the value in a variable in java program? As in if my java code has a variable, . . . . valueA =x.getValue() ..... can... (1 Reply)
Discussion started by: inquisitive101
1 Replies

2. Shell Programming and Scripting

Make a list in bash out of arguments

Hello, I have a very stupid/simple problem, but for some reason I cannot figure out...and I need your help! I am writting a bash scrip that should be executed using "my_script X Y Z T" where X Y Z and T can be any string, but there can be any number of arguments. I want my script to do... (4 Replies)
Discussion started by: jolecanard
4 Replies

3. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

4. UNIX for Dummies Questions & Answers

compare 2 very large lists of different length

I have two very large datasets (>100MB) in a simple vertical list format. They are of different size and with different order and formatting (e.g. whitespace and some other minor cruft that would thwart easy regex). Let's call them set1 and set2. I want to check set2 to see if it contains... (2 Replies)
Discussion started by: uiop44
2 Replies

5. Shell Programming and Scripting

How to make 2 separate arguments in 1 bash script?

This is what I have: #!/bin/bash #ascript.sh WORD1=`tail -n +$1 /home/gscn/word1.txt | head -1` sed -e "s/WORD1/$WORD1/g" < /home/gscn/configtmp > /home/gscn/config WORD2=`tail -n +$1 /home/gscn/word2.txt | head -1` sed -e "s/WORD2/$WORD2/g" < /home/gscn/config2tmp >... (4 Replies)
Discussion started by: guitarscn
4 Replies

6. Shell Programming and Scripting

Flat file-make field length equal to header length

Hello Everyone, I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table. Input Data- ------ ------------------------ ---- ----------------- WFI001 Xxxxxx Control Work Item A Number of Records ------ ------------------------... (5 Replies)
Discussion started by: sonali.s.more
5 Replies

7. Programming

Program java arguments

Hello, The arguments are strings. In my code I need them to be a different type, I do the cast but it is not feasible ... Have you any idea? Thank you (8 Replies)
Discussion started by: chercheur857
8 Replies

8. Shell Programming and Scripting

Passing arguments to interactive program through bash script, here document

Dear Users, I have installed a standalone program to do multiple sequence alignment which takes user parameters to run the program. I have multiple sequence files and want to automate this process through a bash script. I have tried to write a small bash code but its throwing errors. Kindly... (13 Replies)
Discussion started by: biochemist
13 Replies

9. UNIX for Beginners Questions & Answers

Pass RegEx to java program in bash script

I can't seem to get this right. I've tried it every way imaginable using every trick I see on stackexchange and such. No luck. So nothing major here, something like: #!/bin/bash SEARCH="ARG1 ARG2 '((^EXACT$)|(.*InTheMiddle*)|(^AtBeginning*))'" java -cp /my/class/path MyClassName $SEARCH... (3 Replies)
Discussion started by: stonkers
3 Replies
MAVEN(1)							   User Commands							  MAVEN(1)

NAME
Maven - Creates a link from a jar already installed in /usr/share/maven-repo. SYNOPSIS
mh_linkrepojar [option]... [pom] [link]... DESCRIPTION
Create symlinks from the jar in the Maven repository to any location, usually to a file located in /usr/share/java. Where [pom] is the location of the POM associated with the jar to install. GroupId, artifactId and version will be extracted from this file. [link] is a link to the jar to install, usually there should be a link to usr/share/java/$jar.jar and usr/share/java/$jar-$version.jar to comply with the Java packaging guidelines. Note that there is no need to specify those particular links if the --java-lib option is used. OPTIONS
-h --help: show this text -V --version: show the version -p<package> --package=<package>: package to act on -r<rules> --rules=<rules>: gives the location of the rules file for special properties. Optional, the default location is debian/maven.rules -c<classifier> --classifier=<classifier>: Optional, the classifier for the jar in the Maven repository. Empty by default. -v --verbose: show more information while running -n --no-act: don't actually do anything, just print the results Maven Repo Helper version 1.7.1 January 2012 MAVEN(1)
All times are GMT -4. The time now is 08:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy