Apologies for an ultra-stupid question.
I'm trying to use cpio with powershell, and the redirections are... painful. I've read through several stackoverflow answers:
https://superuser.com/questions/654574/pipeline-input-to-executable-with-powershell
Redirecting standard input\output in Windows Powershell
and can't get it to work, but the problem seems to be with the basic invocation of cpio.
For simplicity:
I want to create a file with a list of filenames.
I want CPIO to use this list instead of using standard input.
I want CPIO to create an archive that I name without using standard output.
According to the gnu docs, this should be doable. https://www.gnu.org/software/cpio/manual/html_node/Copy_002dout-mode.html#Copy_002dout-mode
-F [[user@]host:]archive-file
-O [[user@]host:]archive-file
--file=[[user@]host:]archive-file
Use the supplied archive-file instead of standard input. Optional user and host specify the user and host names in case of a remote archive.
However,
$ldclist = get-childitem * -include *out.*
$ldclist.name|%{ "$_" }| out-file -encoding ascii cpiolist
.\cpio.exe -o -O cpiolist >testarc
simply doesn't work. It actually overwrites cpiolist with a blank file (or, depending, "TRAILER!!!"). If I try invoking it from CMD, it seems to be waiting for more inputs (if I hit enter, it says ": Invalid argument")
Any help greatly appreciated.