中级会员
 
- 积分
- 303
- 金钱
- 303
- 注册时间
- 2019-11-10
- 在线时间
- 61 小时
|

楼主 |
发表于 2019-11-10 22:57:15
|
显示全部楼层
我的估计还有一些不太一样,我使用的是之前的busybox制作的文件系统,起初是没有/etc/profile文件的,这个文件是自己添加的,内容就两行:
[\u@\h]:\w$:vi /etc/profile
#export PS1='[$PWD]'
#export PS1="\e[32;40m\w> "
PS1='[\u@\h]:\w$:'
export PS1
~
其实 PS1是显示出来了的,只不过没有根据它的规则输出,然后原样输出了,没有进行替换
[\u@\h]:\w$:
[\u@\h]:\w$:ls
789.txt hello lost+found sbin xwz.txt
bin inittab mnt sys xwz_hello.txt
dev lib proc usr
etc linuxrc root var
[\u@\h]:\w$:
应该是我之前使用的根文系统配置的时候漏了一些细节,单纯的使用PS1还不行。
如果PS1安装规则输出路径的话,那么\w $PWD肯定也能显示出来的。
|
|