Java Runtime String Parsing -
i using java execute python command, i.e.
ctool run <cluster_name> <nodes> <command>
so runs <command>
in given nodes of cluster. example:
ctool run my_cluster 'rm -rf /home/tester/folder'
this runs 'rm -rf /home/tester/folder' on 'all' nodes of 'my_cluster' runs fine terminal when running java runtime string, taking option -p
, -r
, etc. in <command>
ctool option , throwing usage error.
i assuming has how string parsing command. there way can fix issue?
this should work:
process process = new processbuilder("rm","-rf","/home/tester/folder").start(); inputstream = process.getinputstream(); inputstreamreader isr = new inputstreamreader(is); bufferedreader br = new bufferedreader(isr); string out; while ((out = br.readline()) != null) { system.out.println(out); }
Comments
Post a Comment