toyst
V2EX  ›  Bash

sed 如何查找替换反斜杠

  •  
  •   toyst · Feb 6, 2023 · 2181 views
    This topic created in 1191 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   ·   934 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 20:48 · PVG 04:48 · LAX 13:48 · JFK 16:48
    ♥ Do have faith in what you're doing.