I need a command to be executed before shell starts to execute the user passed command,i tried using trap with DEBUG signal, but that did not happen.
I have registered trap in /etc/profile.
trap 'echo "my_command"' DEBUG
Whats happening now is:
sw0:root:root> pwd
/root
my_command
sw0:root:root>
What i want is:
sw0:root:root> pwd
my_command
/root
sw0:root:root>
Bash Version Used:
GNU bash, version 2.04.0(1)-release (powerpc-unknown-linux-gnu)
I want my command to be executed prior to every command entered by user in shell,how do i do that?
Please help me on this,i tried lot of googling but that does not help.