我想要这个Bash提示:
/\ /\
root@debian$:我知道:
PS1="/\ /\\n${debian_chroot:+($debian_chroot)}\u@\h\$:"或者:
PS1="/\ /\\\n${debian_chroot:+($debian_chroot)}\u@\h\$:"但我有:
/\ /
root@debian$:发布于 2019-04-18 10:52:53
PS1本身做了一层额外的解释:
PS1="/\ /\\\\\n${debian_chroot:+($debian_chroot)}\u@\h\$:"
^^^^ 4 backslashes或者更好的是:
PS1="/\\\\ /\\\\\n${debian_chroot:+($debian_chroot)}\u@\h\$:"我得到的输出:
/\ /\
ibug@ubuntu$:支持提示:使用单引号可以节省您自己的一些转义:
PS1='/\\ /\\\n'"${debian_chroot:+($debian_chroot)}"'\u@\h\$:'
^ ^^ ^^ ^https://stackoverflow.com/questions/55743398
复制相似问题