The trap command works differently depending on what shell you are using, but the debug option to trap is 'execution of any command'. The read command's -s option places the command in the user's HISTFILE. So, IMO, your above command places something like the following date string in the HISTFILE:
When I do a $SHELL it return me this /sbin/sh. You are right, I found a lot of date string in the .sh_history file, but I check on all the Unix box and all have that command in the .profile, funny thing is only one Unix box have that date string in the .sh_history file, do you know why?
One more question is why some of the Unix box's .sh_history file will be clear when the dtterm is close, but some is not? the .sh_history file keep on growing in some of the Unix box.
If you are using /sbin/sh, then I'm assuming you are using the Bourne shell (It's not always correct to assume that sh - means Bourne) The Bourne shell doesn't support shell history; Only the moderns shells - ksh, bash, csh - support history.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE