Reputation: 19551
Currently I run my program like this:
java program arg1 arg2 arg3...
There are a variable number or arguments. Is there some BASH script or something I can package with my program to allow me to run it just like
program arg1 arg2 arg3
and continue to allow me to have variable arguments.
I just care about Unix systems.
I'm sorry for this simple question: I'm a Java developer, not a BASH scriptor.
Upvotes: 2
Views: 19258
Reputation: 74750
Here:
#!/bin/bash
java program "$@"
Or if you want the bash to exit when java is called, use this:
#!/bin/bash
exec java program "$@"
(This replaces the bash
process with the java
process instead of waiting until java
returns.)
Upvotes: 10