正在使用批处理生成html。。转义引号
这是为了生成一个包含不同文件的web文档的层次结构,这是因为我很懒正在使用批处理生成html。。转义引号,html,batch-file,escaping,quotes,Html,Batch File,Escaping,Quotes,这是为了生成一个包含不同文件的web文档的层次结构,这是因为我很懒 @echo off echo. echo This program will generate the base folder for a new website .. . pause md folders echo > folders/default.html "<html> /* More content */ </html>" echo > fold
@echo off
echo.
echo This program will generate the base folder for a new website .. .
pause
md folders
echo > folders/default.html "<html> /* More content */ </html>"
echo > folders/style.css " /* All the standards i always use */ "
echo > folders/javascript.js " /* All the standards i always use */ "
echo.
exit
它也能起作用,但问题是,我不能删除/逃避引用,尽管这会让人歇斯底里
我尝试了很多不同的东西。使用类型更改echo,我尝试了在www等上可以找到的不同转义选项,但引号仍然存在。您需要转义所有CMD保留字符
^
(
)
和
使用插入符号^
几点意见
echo ^<!DOCTYPE HTML PUBLIC^> >index.html
echo ^<html^> >>index.html
echo ^<!-- more content --^> >>index.html
echo ^<!-- you don't need to escape ( ) outside blocks --^> >>index.html
echo ^<!-- don't escape inside quotes "&" --^> >>index.html
echo ^</html^> >>index.html
echo^>index.html
echo^>>index.html
echo^可能的副本