I am using a simple for loop to process certain input files and get the output in one file. What I am using is
for k in ../some_directory/*.txt;
do command (containing -i $k -o outputfile.txt);
done
Now each loop gives an output. I want the output to be written in one file. This loop just replaces all the previous files and gives me a number of outputfile.txt files each with the output from every loop. How can I append the command to one file? I don't want the screen output but the output from each of the command.
&>>or>>nstread of-oto get the output. the only difference on those link os>this will overwrite the file again and again if you use>>twice it will append the output.for...doneto a single file. Thecommandshould be capable to direct its output tostdoutby default or by supplying a dash (-) to-ooption (the widely used convention)