问题
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