将stdin复制到stdout的命令 [英] Command which copies stdin to stdout

查看:97
本文介绍了将stdin复制到stdout的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在更新Crystal编程语言标准库的测试套件以在Windows上运行.为了在UNIX上使用stdout和stdin的管道测试新进程的产生, cat 被用作虚拟进程",将stdin复制到stdout进行测试.

I'm updating the test suite of the standard library of the Crystal programming language to run on Windows. To test the spawning of new processes with pipes for stdout and stdin on unix, cat is used as a "dummy process" which copies stdin to stdout for testing.

使用 cmd.exe 命令在Windows上实现相同效果的最简单命令是什么?

What's the simplest command to achieve the same effect on windows using cmd.exe commands?

推荐答案

一个简单的命令,可以在所有Windows版本中找到,可以用作指示的linux cat 命令的替代方法情况是

A simple command that can be found in all windows versions that can be used as an alternative to the linux cat command in the indicated scenario is

find /v ""

照原样,它将从标准输入读取行并将其写入标准输出.

As is, it will read lines from standard input and write them to standard output.

注意:虽然有时可以使用 more findstr"^" ,但它们都有一些局限性,使得 find/v" 更好的选择.

note: While more and findstr "^" could, sometimes, be used, both have several limitations that make find /v "" a better alternative.

这篇关于将stdin复制到stdout的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆