V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
toyst
V2EX  ›  Bash

sed 如何查找替换反斜杠

  •  
  •   toyst · Feb 6, 2023 · 2143 views
    This topic created in 1179 days ago, the information mentioned may be changed or developed.
    a='\u@\h:\w\$ '
    a='\[\e[1;32;40m\][\u@\h - \t \W]\$ \[\e[0m\]'
    

    想实现把

    \u@\h:\w\$ 
    

    替换成

    \[\e[1;32;40m\][\u@\h - \t \W]\$ \[\e[0m\]
    
    2 replies    2023-02-06 11:04:34 +08:00
    rrfeng
        1
    rrfeng  
       Feb 6, 2023 via Android
    \\
    toyst
        2
    toyst  
    OP
       Feb 6, 2023
    还有 \t 制表符 和 $ 标记
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   885 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 19:29 · PVG 03:29 · LAX 12:29 · JFK 15:29
    ♥ Do have faith in what you're doing.