Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
blueionic
V2EX  ›  Linux

bash shell 里的 soft quoting 问题

  •  
  •   blueionic · Oct 3, 2015 · 2469 views
    This topic created in 3900 days ago, the information mentioned may be changed or developed.
    soft quoting 里面有$,!,`和\这个四个不会禁用。
    但是为什么
    [root@ZZZZ ~]# echo "\n"
    \n


    [root@ZZZZ ~]# echo "\\"
    \

    我已经搞晕了。。
    4 replies    2015-10-03 19:06:14 +08:00
    Ansen
        1
    Ansen  
       Oct 3, 2015 via iPhone
    echo "/\n"
    lululau
        2
    lululau  
       Oct 3, 2015   ❤️ 1
    The backslash retains its special meaning only when followed by one of the following characters:
    $, `, ", \, or <newline>.
    blueionic
        3
    blueionic  
    OP
       Oct 3, 2015
    @Ansen LZ 的意思是如果按照 soft quoting 的说法,""不会 disable 掉\,所以 echo "\n"应该会得到 n ,而不是\n 。
    blueionic
        4
    blueionic  
    OP
       Oct 3, 2015
    @lululau get 到点了。。谢谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2934 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 12:44 · PVG 20:44 · LAX 05:44 · JFK 08:44
    ♥ Do have faith in what you're doing.