1
で:(パイプを使用して|)の2つのコマンドを使用して私は、端末のメモリと印刷(pdftotext)でPDF(unoconv)にドキュメントを変換してるのspawn
unoconv -f pdf --stdout sample.doc | pdftotext -layout -enc UTF-8 - out.txt
取り組んでいます。今、私はchild_process.spawn
でこのコマンドを使用します:
let filePath = "...",
process = child_process.spawn("unoconv", [
"-f",
"pdf",
"--stdout",
filePath,
"|",
"pdftotext",
"-layout",
"-enc",
"UTF-8",
"-",
"-"
]);
この場合、(前|)のみ最初のコマンドが働いています。私は何をしようとしているのですか?
ありがとうございました。
UPDATE-
結果の:パイプで始まるsh -c- ....
bash-3.2$ sh -c- unoconv -f pdf --stdout /Users/fatimaalves/DEV/xx/_input/sample.doc | pdftotext -layout -enc UTF-8 - -
sh: --: invalid option
Usage: sh [GNU long option] [option] ...
sh [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--protected
--rcfile
--restricted
--verbose
--version
--wordexp
Shell options:
-irsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP or -o option
Syntax Warning: May not be a PDF file (continuing anyway)
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't read xref table
うーん、私は何を使用する必要があり、この場合には、ウィンドウを使用していますか? –
代わりに、最初のコマンドから出力を取得し、2番目のコマンドで再びspawnを実行できますか? –
@Trott、私は私のMacBookで試して、結果はnullです –