How Do I Run a Login Script in Linux?
Contents How Do I Run a Login Script? Run Chmod +X Weather. Sh to Make It Executable, and Place It in the /Etc/Profile. D/ Directory. Now Whenever a User Logs...
Contents
How do I run a login script?
Run chmod +x weather.sh to make it executable, and place it in the /etc/profile. d/ directory. Now whenever a user logs in, this script will run and automatically display the weather forecast. Of course, this applies to any other task you’d want to run as well.
Must Read
How do I run a script in Linux terminal?
Steps to write and execute a script
- Open the terminal. Go to the directory where you want to create your script.
- Create a file with . sh extension.
- Write the script in the file using an editor.
- Make the script executable with command chmod +x <fileName>.
- Run the script using ./<fileName>.