1. The following 2 types of syntax are both ways to execute a script. Using these methods a second shell will be opened and once the script has finished the variables will not persist.
chmod +x [script]
2. Below shows you a way in which you can run your script using the current shell, and once the script has finished the variables will persist.
This would be useful in a scenario when you were making changes to your profile variables and wanted to activate the changes without logging off.
3. The final way terminates you current shell, and spawns a new shell in order to run the script. Once the script has completed the user will be logged off.
This can be useful to isolate and restrict certain users and their profiles.
- How to Configure a BIND Server on Ubuntu - March 15, 2018
- What is a BGP Confederation? - March 6, 2018
- Cisco – What is BGP ORF (Outbound Route Filtering)? - March 5, 2018
Want to become a Linux expert?
Here is our hand-picked selection of the best courses you can find online:
Linux Mastery course
Linux Administration Bootcamp
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial