重定向到文件会在 Powershell 中添加额外的返回值吗?
以下想要对输出进行换行:
ss "Call Info-.*66000" *1006*.log -Context 2,2 > ../test.txt
为什么?
ss
是 Select-String
的别名。
有没有办法让它不向数据添加换行符?
编辑: 当它得到类似的东西时:
... 80 characters ... This line is too long 55000
... 80 characters ... This line is too long 55000
... 80 characters ... This line is too long 66000
... 80 characters ... This line is too long 44000
... 80 characters ... This line is too long 40000
它会产生类似的东西:
... 80 characters ...
This line is too long 55000
... 80 characters ...
This line is too long 55000
> ... 80 characters ...
This line is too long 66000
... 80 characters ...
This line is too long 44000
... 80 characters ...
This line is too long 40000
在输出文件中?!?!?!?!?我可以理解换行到屏幕,但是文件呢?这太奇怪了。 (日志文件实际上看起来与此完全不同,其中一些行长达数百个字符。)
The following wants to line wrap the output:
ss "Call Info-.*66000" *1006*.log -Context 2,2 > ../test.txt
Why?
ss
is a alias for Select-String
.
Is there a way to make it not add linebreaks to the data?
Edit:
When it gets something like:
... 80 characters ... This line is too long 55000
... 80 characters ... This line is too long 55000
... 80 characters ... This line is too long 66000
... 80 characters ... This line is too long 44000
... 80 characters ... This line is too long 40000
it produces something like:
... 80 characters ...
This line is too long 55000
... 80 characters ...
This line is too long 55000
> ... 80 characters ...
This line is too long 66000
... 80 characters ...
This line is too long 44000
... 80 characters ...
This line is too long 40000
IN THE OUTPUT FILE?!?!?!?!? I can understand wrapping to the screen but the file? That's just bizarre. (The log file actually looks nothing like this and some of the lines are hundreds of chars long.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试做:
Try doing: