我想自定义我的提示。这是我的问题:
root@server:~# PS1="[\@]\$" // should write [05:40 PM]
[05:40 ]$
也许这可以成为一个线索?
root@server:~# LANG=en_EN.UTF-8
root@server:~# date +%T%p
17:25:05PM
现在 :
root@server:~# LANG=fr_FR.UTF-8
root@server:~# date +%T%p
17:25:15
root@server:~# date +%p
root@server:~#
非常感谢 !
编辑 1:这对 PS1 没有任何改变!
root@server:~# LANG=en_EN.UTF-8
root@server:~# PS1="[\@]\$"
[05:40 ]$
编辑 2: 效果很好,但我预计不需要的更改:
root@server:~# LC_ALL=C
root@server:~# PS1="[\@]\$"
[06:34 PM]$
但是我在输入locale
前后没有发现语言环境的差异LC_ALL=C
!
root@server:~# PS1="[\@] \$"
[06:44 ] $locale
LANG=fr_FR.UTF-8
LANGUAGE=
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=
[06:44 ] $env
// ...
LANG=fr_FR.UTF-8
// ...
然后 :
[06:45 ] $LC_ALL=C
[06:45 PM]$locale
LANG=fr_FR.UTF-8
LANGUAGE=
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=
[06:46 PM] $env
// ...
LANG=fr_FR.UTF-8
// ...
还有什么其他变量会LC_ALL
改变?!...