1752339 Members
5557 Online
108787 Solutions
New Discussion юеВ

Using trap

 
SOLVED
Go to solution
Chandrahasa s
Valued Contributor

Using trap

Hi Gurus,

I am using trap for updating history file with time stamp,

trap 'date "+# %c" | read -s' debug

Here this will update time stamp,
i want to get "who am i" out also histfile.
Kindly help to format trap syntax for this.

Chandra

3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: Using trap

Hi Chandra:

Try this:

# trap 'print -s $(who am i; date)' DEBUG

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: Using trap

Hi (again):

And you would probably want:

# trap 'print -s $(date "+# %c"; who am i)' DEBUG

Regards!

...JRF...
Chandrahasa s
Valued Contributor

Re: Using trap

Thanks to all.

Chandra