I am trying to write a one line command to create 20 empty files with names extracted from a .txt file in another folder directory with the same txt extension.
for i in $(cat test.txt); do grep -w $i | touch $i.txt ; done
cat test.txt| while read line ; do grep $line ; touch $line.txt ; done
as well as
for filename in $(cat testfile.txt) ; do touch head -20 $filename.txt; done
It does not work. I do not know how to specify the 10 first words of the test.txt file.