Trap Commands
I have very little background using Linux and I am having a bit of an issue. I am trying to utilize the trap command to display a list of logged on users each time I log out. I was attempting to us trap ls/who exit. However, this does nothing for what I am trying to do. Any help would be greatly appreciated!!
|
Please show your code? Just the trap, what signal it is being called on and what function you call the trap to perform.
|
Trap is brand new to me so I have no clue.
|
I am not sure why you're using a trap command to do this. Assuming that you're running the bash shell, you can create a file called .bash_logout in your home directory and them put the ls and who commands in it. That file will be run every time you log out, and the output of those commands will be displayed in your terminal.
|
Quote:
As mentioned above, you may be trying to use the wrong tool for the job, but you should at least read up on something prior to using it and asking questions which may be in general literature. |
Ok, at the prompt I entered :$bash
then at the 2nd prompt:$ trap who exit lastly :$ exit (which provided a list of logged on users) |
So your issue is solved? Please mark as such from the Thread Tools
|
All times are GMT -5. The time now is 09:41 PM. |