命令行保留令牌
使用 CLI 构建应用程序时,避免使用通常用于 shell 功能的标记非常有用。
例如,|
用于将一个应用程序的输出传输到下一个应用程序的输入。
请提供需要转义才能使用的令牌的完整列表?
作为最低限度/摘要,对于每个令牌,请确定适用的操作系统/shell、令牌用途的简单说明以及任何转义方法。
(一旦上述内容明确,欢迎提供其他有用的信息。)
When building an application with a CLI, it is useful to avoid using tokens that are commonly used for shell features.
For example, |
is used for piping output of one application to input of the next.
Please supply a complete list of tokens that would need to be escaped to be used?
As a minimum/summary, for each token, please identify the applicable OS/shell(s), a simple explanation of what the token does, and any escape methods.
(Other useful information is welcome, once the above is clear.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从 Unix 的 开始怎么样?
What about starting with Unix ones
费尔南多·米盖雷斯为您提供了极好的信息来源。 规定哪些字符没有特殊含义几乎更容易。 该列表将是:
任何其他 ASCII 标点符号在某个地方都有一些特殊的意义。 该列表中的某些成员与另一个角色组合具有特殊意义; 例如,“
$@
”和“$-
”都是特殊的,但“$
”告诉您这一点,而不是“@
' 或 '-
'。Fernando Miguélez has given you an excellent source of information. It is almost easier to stipulate which characters do not have a special meaning. That list would be:
Any other ASCII punctuation character has some special significance, somewhere. Some members of that list have special significance in combination with another character; for example, '
$@
' and '$-
' are both special, but the '$
' tells you that, rather than the '@
' or '-
'.在 Windows 和 MS-DOS 系统上,以下文件名无效:
在极少数情况下,您可以绕过此限制并创建此类文件,但在尝试访问或查看它们时会遇到问题。
On Windows and MS-DOS systems, the following are invalid filenames:
In the rare cases where you can work around this restriction and create such files, you will encounter problems trying to access or view them.