Change PS1 after running the 'script' command

不打扰是莪最后的温柔 提交于 2019-12-12 05:36:33

问题


I am looking to create a logging system for every command and some timestamps.

I think the "script" command would be the best because you get a log of the input and output.

Now the problem is when I start the script command the PS1 (the command line prompt, which shows the user and PWD) gets changed from:

PS1=`echo $LOGNAME`@`hostname`:'$PWD# '

to

PS1=\s-\v\$ 

and I can't see to get it to switch back. I have tried to change it in both /etc/profile (where the script command is called) and in the users directory /home/.profile. But when I su - to the user to start the logging it still is wrong.

来源:https://stackoverflow.com/questions/37180020/change-ps1-after-running-the-script-command

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!