toyst
V2EX  ›  Bash

sed 如何查找替换反斜杠

  •  
  •   toyst · Feb 6, 2023 · 2757 views
    This topic created in 1372 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
    rrfeng
    Feb 6, 2023 via Android
    1
    \\
    toyst
    toyst
    OP
    Feb 6, 2023
    2
    还有 \t 制表符 和 $ 标记
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   949 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:57 · PVG 03:57 · LAX 11:57 · JFK 14:57
    ♥ Do have faith in what you're doing.