V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
blueionic
V2EX  ›  Linux

bash shell 里的 soft quoting 问题

  •  
  •   blueionic · Oct 3, 2015 · 2393 views
    This topic created in 3859 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   ·   1077 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 18:37 · PVG 02:37 · LAX 11:37 · JFK 14:37
    ♥ Do have faith in what you're doing.