Tracing a user login in SCO Unix Operserver 5.0.7

Hi All,
Hope you can help, I have 2 different logins which I use on the server but I am unable to find which files are being run by each login as they have different home directories.

Is there a way to trace which files are being executed and what directories they are in after entering the user ID and password?

Example: I have found all of the .profile files for user richard and put echo and sleep statements in but these do not appear to be run?

How do I find what is being run and from where

Logging in remotely via PuTTy

Any help would be appreciated.

Regards Richard

You should first make sure these commands you wish to execute work property and echo to the command line without the .profile login.

Are both profiles the same?
Can you post one or both of them?

The statements that I am using work correctly for the login ID I can find a .profile file for in the users HOME directory ($TERM $PORT $USER), but the one in question does not have a HOME directory so I am trying to establish its starting point and what is being run.

Then what is the content of the line in /etc/passwd for the user in question?