Windows批处理的heredoc? [英] heredoc for Windows batch?

查看:28
本文介绍了Windows批处理的heredoc?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法以类似于 unix shell 中的 heredoc 的方式批量指定多行字符串.类似于:

Is there a way of specifying multiline strings in batch in a way similar to heredoc in unix shells. Something similar to:

cat <<EOF > out.txt
bla
bla
..
EOF

这个想法是从模板文件创建一个自定义文件..

The idea is to create a customized file from a template file..

推荐答案

据我所知.

我所知道的最接近的是

> out.txt (
    @echo.bla
    @echo.bla
    ...
)

(@ 阻止命令 shell 本身打印它正在运行的命令,而 echo. 允许您以空格开始一行.)

(@ prevents the command shell itself from printing the commands it's running, and echo. allows you to start a line with a space.)

这篇关于Windows批处理的heredoc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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