After sudo su -
, I want to have both the username and timestamp in the k-shell history list. I have the command line:
trap 'who am i|cut -d" " -f1 |tr "\n" " " && date|read -s' debug
With this command, I expect something like:
UserName Tue Oct 13 15:37:06 CDT 2015
in the history list. However it shows only Tue Oct 13 15:37:06 CDT 2015
This seems to be executing the second action date
only, and ignores or overrides the first action.
How can I have the username and timestamp in the history list?
Noting that the reason why the user name is needed is that multiple users have the same impersonation right to the same service user.