Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

wild card characters not excepted in Runtime.exec()

843829Apr 1 2002 — edited Apr 1 2002
Hi
When I try to execute a command on solaris using Runtime.exec(), it fails if the commond had wildcard characters. but its successful otherwise. I try the comand first on the prompt before trying thru exec()
e.g.
Runtime r = Runtime.getRuntime();
r.exec( "rm *.c"); //FAILS since it has wildcard
r.exec("rm aa.c");//SUCCESSFUL since no wildcard

I tried this with many commands with and without wildcards and wildcard always failed. exit status is non 0 indicatind a failure.

Please help
Thanks
Sachin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2002
Added on Apr 1 2002
2 comments
239 views