Hi:
I have a requirement as below:
I have some standard Unix commands modified and kept them in a directory say /usr/clsh/bin. For example I have a script named "ls" kept here which is modified version of "ls" (say it always gives long listing i.e. ls -l).
When any user logs on and types commands, I want this dir (/usr/clsh/bin) to be looked upon first to check if modified version of the command is available. If yes execute that else execute normal command.
I have implemented it by writing a script say "clsh.bash" which changes PATH to PATH=/usr/clsh/bin:${PATH}. This script I am executing from /etc/profile so that it applies to all the users. So when user logs on his PATH will be changed. And in this case if he issues "ls" it will execute my modified version of "ls" that I kept in /usr/clsh/bin. If user issues any other command then it will normally be executed as there is no equivalent script available in /usr/clsh/bin.
This works fine.
But user can always revert back to original PATH by changing PATH variable. I don't want to happen this and also when user types in "echo $PATH" he will know that the PATH is been modified, I don't want to happen that either.
So basically I would like to know if there is any workaround for this or there is any alternate method to achieve this.
Your help is most appreciated so please guide me with your expert comments.
Thanks is advance and hope to get your answers quickly.
Regards,
Ramesh
---------- Post updated at 01:41 AM ---------- Previous update was at 12:25 AM ----------
39 views and no replies yet
Please let me know if more information is needed or I am not making myself clear. Thanks.