I have a problem with the following code (Perl/Cygwin)
#!/usr/bin/perl
open FILE, ">", "filename.txt" or die $!;
print FILE "A\n";
print FILE "B\n";
print FILE "C\n";
close (FILE);
system("xargs echo E < filename.txt");
I want it to invoke echo three times and print
E A
E B
E C
but instead it outputs
E A B C
I have tried various things with the xargs delimiter settings to no avail. Can anyone help?