Need help in writing AIX ksh scripting

I need to write the script for the below constraints. Need your help urgently

The PATH environment variable must conform to the following:
� World-writeable directories (/tmp, /var/tmp etc) must not be placed in the PATH variable.
� System directories must always be placed before local directories in the PATH variable.
� Where there is a requirement for a user to have the current working directory �.' or other relative path in their PATH, it must be placed at the end
� Where $HOME is included in PATH, it must be included at the end (or immediately before any relative paths if these are also required).
� The PATH must not begin or end with a colon.
� Users must not have access to another user's PATH.

need to check for all the users PATH for the above constraints...:rolleyes::confused:

In other words .profile or .kshrc should only be readable by <user>...

All the check should be done on default PATH setting then what is left is the "custom" part in users .profile or .kshrc knowing it will be of the form:

PATH=$PATH:<cutomized user paths...>