• 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

executing bash script doesn't work

 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i neet to execute one script from java app. In command line I execute id sh world Monika.
world is the script and Monika is parameter



why this piece of code doesn't work?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well there are a number of possible problms I think - it's hard to say without know more about what "world" and "Monika" are. Not to mention, what OS are you using? (Some sort of Unix I assume, but more info might be helpful.) Most importatnly, you probably need to get tthe Process insance associated with your exec() command, and read what is being written to standard error and standard output. (And you really should do this using separate threads.) This JavaWorld article has more info.
 
Pavel Kubal
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jim,

Im using linux with core 2.4.22. Solved it using Process instance associated with exec command as you said. Thank you.

btw: what is world and Monika was said in the first post
 
reply
    Bookmark Topic Watch Topic
  • New Topic