shell script passing arguments

Posted by arav on Stack Overflow See other posts from Stack Overflow or by arav
Published on 2010-03-26T00:59:06Z Indexed on 2010/03/26 1:03 UTC
Read the original article Hit count: 296

From the wrapper shell scripts i am calling the Java program. I want the Unix shell script to pass all the arguments to java program except the EMAIL argument. HOW Can i remove the EMAIL argument and pass the rest of the arguments to the java program. EMAIL argument can come at any position.

valArgs() {

until [ $# -eq 0 ]; do
    case $1 in
        -EMAIL)
            MAILFLAG=Y
            shift
            break
            ;;
    esac
done

}

main()

{

valArgs "$@"

$JAVA_HOME/bin/java -d64 -jar WEB-INF/lib/test.jar "$@"

© Stack Overflow or respective owner

Related posts about unix-programming

Related posts about unix