Problem scenario
You want a script to run whenever a user logs in (e.g., when a sudoer uses “su jdoe”, you want a script to run before you assume the jdoe user). You are using Linux SUSE or Ubuntu or a Debian distribution. You found that having a script in /etc/profile.d/ does not work. What should you do?
Solution
To have a script automatically run for a given user,
…
Continue reading “How Do You Get a Script to Execute Every Time You Log in as the User in Linux?”