🐚 Shell 参数转义(Bash / PowerShell / cmd)Shell Argument Escaper — Bash, PowerShell, cmd
把含空格、引号、$、!、换行的文本转成能安全放进命令行的单个参数:Bash/Zsh/sh 单引号、双引号、$'…' 写法,PowerShell 单引号,Windows 程序参数和 cmd.exe;还能按 POSIX 规则把一条命令拆成参数列表,检查引号是否写对。Turn text with spaces, quotes, $, ! or newlines into one safe command-line argument — Bash/Zsh/sh single, double and $'…' quoting, PowerShell, Windows program arguments and cmd.exe — or split a command into argv by POSIX rules to check your quoting.
把含空格、引号、$、!、换行等特殊字符的文本安全地作为一个参数传给命令。Bash/Zsh/sh 推荐单引号写法:单引号内一切按字面处理,唯一要处理的是单引号本身(写成 '\'')。“解析命令行”按 POSIX shell 的引号规则拆分参数(不执行任何命令,也不展开变量和通配符)。Pass text containing spaces, quotes, $, !, newlines… safely as ONE argument. For Bash/Zsh/sh, single quotes are best — everything inside is literal; only the quote itself needs '\''. “Command line → argv” splits by POSIX shell quoting rules (nothing is executed; variables and globs are not expanded).
使用说明与常见问题How-to & FAQ
「Shell 参数转义(Bash / PowerShell / cmd)」是什么?What is the Shell Argument Escaper — Bash, PowerShell, cmd?
把含空格、引号、$、!、换行的文本转成能安全放进命令行的单个参数:Bash/Zsh/sh 单引号、双引号、$'…' 写法,PowerShell 单引号,Windows 程序参数和 cmd.exe;还能按 POSIX 规则把一条命令拆成参数列表,检查引号是否写对。Turn text with spaces, quotes, $, ! or newlines into one safe command-line argument — Bash/Zsh/sh single, double and $'…' quoting, PowerShell, Windows program arguments and cmd.exe — or split a command into argv by POSIX rules to check your quoting.
如何使用「Shell 参数转义(Bash / PowerShell / cmd)」?How do I use the Shell Argument Escaper — Bash, PowerShell, cmd?
在“字符串 → 安全参数”中粘贴原始文本,复制对应 Shell 的结果;在“解析命令行”中粘贴整条命令,查看它会被拆成哪些参数。Paste raw text under “Text → safe argument” and copy the result for your shell; paste a whole command under “Command line → argv” to see how it splits.
单引号里怎么写单引号?How do I put a single quote inside single quotes?
Bash 单引号内不能转义,需要先结束引号、写 \',再重新开始:'It'\''s'。本工具会自动处理。You can’t escape inside single quotes — close, add \', reopen: 'It'\''s'. The tool does it for you.
解析命令行会执行命令吗?Does splitting run the command?
不会。只是在浏览器里按引号规则拆分文本,不执行命令,也不展开变量和通配符。No — it only splits text by quoting rules in the browser; nothing runs and variables/globs aren’t expanded.
「Shell 参数转义(Bash / PowerShell / cmd)」免费吗?文件会上传吗?Is the Shell Argument Escaper — Bash, PowerShell, cmd free? Are my files uploaded?
「Shell 参数转义(Bash / PowerShell / cmd)」完全免费,无需注册。你输入的内容只在本机浏览器里处理(部分设置会保存在本机方便下次使用),不会上传到任何服务器。The Shell Argument Escaper — Bash, PowerShell, cmd is free with no sign-up. What you enter is processed only in this browser (some settings are kept locally for next time) and is never uploaded.