May be this question is too easy but it took a lot my time but I could not figure out. I am trying to execute echo
command in which I am trying to append some data in a text file. Everything works when run in terminal but when I try to run it through Runtime.getRuntime().exec("echo my text >> file.txt")
, then >> does not work.
Is there any way to give code or something so that this command should work? I tried >
but it did not work for me.