wood burning stoves 2.0*
The moose likes Linux / UNIX and the fly likes Reading the arguments from .CSH file which is in next line at runtime thru java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Reading the arguments from .CSH file which is in next line at runtime thru java class" Watch "Reading the arguments from .CSH file which is in next line at runtime thru java class" New topic
Author

Reading the arguments from .CSH file which is in next line at runtime thru java class

Balaji Soundarajan
Ranch Hand

Joined: Jan 23, 2009
Posts: 59
I am calling java class in .csh script file with command line arguments like Java storagesrv start -c - and I am validating the command line arguments in java class and if hyphen "-" is there in the command line argument then I have to read the value from next line in the csh file.

The csh file looks like

java storeSrv start -c -
dbs/formtek@vault


Need to read the dbs/formtek@vault value at runtime in storeSrv java class.
Kindly give me some idea to read the arguments which is in next line....

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

What you need is called a "here data" stream.

Do it like this:



This tells the shell to consider every line up to the declared terminator (EOF) to be part of the stdin to the application. You can usually also do shell variable substitution in the data stream, though it may depend on which shell you use.>


Customer surveys are for companies who didn't pay proper attention to begin with.
Balaji Soundarajan
Ranch Hand

Joined: Jan 23, 2009
Posts: 59
Thank you very much, it is working dude.


O
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Reading the arguments from .CSH file which is in next line at runtime thru java class
 
Similar Threads
Passing Jave object arrays
Get environment variables
valid syntax
Help to use command Line argument with ant
Read arguments from .csh file which is in next line thru Java class