开发者

shell piping and the cat command... on Windows

开发者 https://www.devze.com 2023-04-04 16:08 出处:网络
With most Unix shells, we can use the powers of pipe and the cat command to concatenate non-text data like the following example:

With most Unix shells, we can use the powers of pipe and the cat command to concatenate non-text data like the following example:

a_command_with_binary_output | cat - this_is_a_binary_file > output_file

What is the equivalent of the above command in Windows? I'm only target开发者_StackOverflow社区ing command.com or cmd.exe. No powershell please.


Well if you can spare the temporary space:

a_command_with_binary_output > temp_file
copy /B temp_file + this_is_a_binary_file output_file
del temp_file

But do yourself a favor and get coreutils for Win32. That contains cat and a bunch of other handy utilities.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号