• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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....

 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.>
 
Balaji Soundarajan
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much, it is working dude.


O
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic