I have code which counts each word occurrence means how many each word appears in the string.
I want to copy all the count data to the new file
for w in `cat tes.txt`; do echo $w; done | cp w test.txt
in test.txt file, only the result total line shows up and nothing