Please follow the steps to fix the problems in /etc/profile output file.

Step1: #/usr/bin/diff /usr/newconfig/etc/profile /etc/profile

diff command will compare the above two files and sorts the contents. If you
receive any differences in the files after executing the above command
follow step2.

Step 2:#/usr/bin/cp /usr/newconfig/etc/profile /etc

HPUNIX maintains all default files and directories pertaining to Operating
systems under /usr/newconfig.If there is some problem with any of files.In
your case it is /etc/profile file; you always have the leniency to retrieve
the default file and copy the same in /etc location.

I have also sent you an attachment it contains details on how a /etc/profile
should look like.

Best Regards,
Mahesh.R.M.
Senior Systems Engineer (HPUNIX).

Help the community by fixing grammatical or spelling errors, summarizing or clarifying the solution, and adding supporting information or resources. Always respect the original author.

Please follow the steps to fix the problems in /etc/profile output file.

Step1: #/usr/bin/diff /usr/newconfig/etc/profile /etc/profile

diff command will compare the above two files and sorts the contents. If you
receive any differences in the files after executing the above command
follow step2.

Step 2:#/usr/bin/cp /usr/newconfig/etc/profile /etc

HPUNIX maintains all default files and directories pertaining to Operating
systems under /usr/newconfig.If there is some problem with any of files.In
your case it is /etc/profile file; you always have the leniency to retrieve
the default file and copy the same in /etc location.

I have also sent you an attachment it contains details on how a /etc/profile
should look like.

Do the following:
I suppose you are root, then:
1) /usr/bin/cd /
2) /usr/bin/vi .profile
enter i for input,
3) Enter PATH=/usr/bin:/usr/sbin:/etc
4) Save and exit
5) Log out and login again to root
Now you'll have the minimum requirements for commands execution, you may
update .profile later on and add necessary entries as needed, later on.

Eish, I am screwed .. still not working. In the meantime I have found a workaround - I have created another user with the sam UID as root which is working fine. Are there any repercussions in doing that?