在linux shell脚本中,如何安全的插入一段windows命令到文件中,供windows使用?

发布于 2022-09-12 03:49:18 字数 86 浏览 13 评论 0

在linux shell脚本中,如何安全的插入一段windows命令到文件中,供windows使用?
遇到Windows命令中的斜杠等特殊符号,如何转义

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

∞梦里开花 2022-09-19 03:49:18

man echo

If -e is in effect, the following sequences are recognized:

  • \\ backslash
  • \a alert (BEL)
  • \b backspace
  • \c produce no further output
  • \e escape
  • \f form feed
  • \n new line
  • \r carriage return
  • \t horizontal tab
  • \v vertical tab
  • \0NNN byte with octal value NNN (1 to 3 digits)
  • \xHH byte with hexadecimal value HH (1 to 2 digits)

另外,在 bash 里:

A non-quoted backslash (\) is the escape character. It preserves the literal value of the next character that follows, with the exception of <newline>. If a \<newline> pair appears, and the backslash is not itself quoted, the \<newline> is treated as a line continuation (that is, it is removed from the input stream and effectively ignored).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文