jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes executing bash script doesn't work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "executing bash script doesn Watch "executing bash script doesn New topic

executing bash script doesn't work

Pavel Kubal
Ranch Hand

Joined: Mar 13, 2004
Posts: 356
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

Joined: Jan 30, 2000
Posts: 18671
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.

"I'm not back." - Bill Harding, Twister
Pavel Kubal
Ranch Hand

Joined: Mar 13, 2004
Posts: 356
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
I agree. Here's the link: http://aspose.com/file-tools
subject: executing bash script doesn't work
It's not a secret anymore!