I need to filter the content of one file (javasrc.txt) by the contents of a second file (OEMDS.txt). This needs to be done in a Windows environment. I don't know about Windows batchfiles, I know about UNIX commands, I'm new at Perl and I would like to make my life as easy as possible, so I have thought of writing a UNIX command, put "system()" around it and it should work.
Unfortunately it seems not to be that simple: the following Perl script refuses to work:
system("cat javasrc.txt | grep -v qx(cat OEMDS.txt) > javasrc_temp.txt");
I get error message:
grep: OEMDS.txt): No such file or directory
For your information: I have already used the following for launching the cat
command:
- backticks
- $()
- qx()
- qx{}
Always the result is the same: Perl seems to have an issue with the terminating character (the second backtick or comma, ...)
Now that I think about it, I launch this in the following way (I don't know if it's relevant):
perl filter_by_file_content.pl
Does anybody know what I can do?
Copyright License:
Author:「Dominique」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/39105076/how-to-use-unix-commands-in-perl-to-be-used-on-a-windows-machine