Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executing bash script doesn't work

 
Pavel Kubal
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • 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?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic