Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shell script

Status
Not open for further replies.

testing12

Instructor
Jan 19, 2005
1
US
Hi Guys,
I am new to unix environment , familiar with basic unix commands.
I want to have a shell script which runs java exe and which exe also takes on flat file as input .
so what command do i need to use to run java exe and how to pass input flat file.

Looking forward for help


thanks
 
Assuming you're using Bash or a similar shell, and assuming the Java interpreter is called [tt]java[/tt] and is in the PATH, and assuming Whatever.class is the file containing the main function, and assuming it's in CLASSPAH or equivalent, and assuming I understand what you asked for:
Code:
#! /bin/sh

[ $# -ne 1 ] && {
    echo "Need an input file" >&2
    exit 1
}

java Whatever $1


If that's wrong, rephrase what you want; it's not really clear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top