【发布时间】:2015-07-20 12:37:25
【问题描述】:
我正在尝试使用 Powershell 运行bayes-seg 程序:cat data/books/clinical/050.ref | ./segment config/dp.config。
我了解命令cat 输出文件,pipe 将使用输出作为./segment config/dp.config 的参数
运行上述命令时。我遇到了例外:
Cannot run a document in the middle of a pipeline: C:\Users\name\Desktop\bayes-seg-master\segment.
At line:1 char:35
+ cat data/books/clinical/050.ref | ./segment config/dp.config
+ CategoryInfo: InvalidOperation: (C:\Users\name\...-master\segment:String) [], RuntimeException
+ FullyQualifiedErrorId : CantActivateDocumentInPipeline
是什么导致了这个异常?我在谷歌上环顾四周,找不到任何详细解释异常的东西。任何帮助将不胜感激。
【问题讨论】:
-
您找到解决方案了吗?
-
不,这是将我推向 linux 的许多最后一根稻草之一。从那以后再也没有回头。
-
奇怪。其他外部命令工作正常:
cat file1 | findstr 1,假设 segment.exe 采用管道输入。 -
那个网站说segment是一个unix脚本。它不会在 Windows 中运行。
-
由于这是一个无法在 Windows 中运行的 unix 脚本,我将关闭它。
标签: powershell powershell-2.0 powershell-3.0