当我在终端中输入参数时会出现更大的运算符 (>)

Ste*_*eam 2 command-line

我发现它发生是因为它拆分了输入的参数。但我正在创建一个加密字符串的程序,并将“测试”加密为|m{|. 但是当我切换到解密模式时,事情就会发生。任何解决方案?

wal*_*tor 5

>来自bash$PS2变量。man bash说:

PS2    The value of this parameter is expanded as with PS1 and used as the secondary prompt string.  The default is ``> ''.
Run Code Online (Sandbox Code Playgroud)

我经常看到>当我有一个不匹配的引号 ( ") 或撇号 ( ') 或其他一些被bash视为不完整的输入时。

  • ...如果您在 shell 中输入 `"|m{|"` `'|m{|'` 作为程序的参数,您的程序将看不到引号(它们只会阻止 shell 尝试解释序列) (3认同)