I have 3 files: a.txt
, b.txt
and c.txt
. I want to create 3 files: a.test
, b.test
and c.test
containing the simple text abracadabra
.
Basicaly, the point is to create the .test
files for each .txt
file, and fill them with some text. I am trying to use xargs
to do this.
anlx2626> ls
a.txt b.txt c.txt
anlx2626> ls *.txt | awk -F'.txt' '{print $1}' | xargs -I {} echo "abracadabra" > {}.test
anlx2626> ls *.test
ls: No match.
Could someone point out why using the {}
placeholder for
line-by-line pipe doesn't work the way I expect it to?