Hi, does anyone know why if I log in as a particular user running the bash shell. su - sag and enter the password and then I type history, I get the history of commands. But if i log in as follows from root: su - sag -c "history" , then no history gets printed ? Thanks, Kieran This email and all contents are subject to the following disclaimer: "http://www.didata.com/disclaimer.asp"
* Kieran Swanepoel (kieran.swanepoel@za.didata.com) [030807 06:32]:
su - sag and enter the password and then I type history, I get the history of commands. But if i log in as follows from root: su - sag -c "history" , then no history gets printed ?
I think it's because 'su - -c' doesn't start an interactive shell so $HISTFILE is unset, but I'm not positive. 'su - sag -c "cat ~/.bash_history"' should do what you want (minus the last command of course). -- -ckm
participants (2)
-
Christopher Mahmood
-
Kieran Swanepoel