Popular
Latest Articles
- How to determine the Syslog Facility using Tcpdump
- Oracle 11g / Fedora 13 - Error in invoking target 'agent nmb nmo nmhs tclexec'
- Cisco Router Zone Based Firewall Configuation Guide - Video Tutorial
- Installing GNS3 0.7.2 onto Fedora 13
- Configuring a Pre-Shared Site to Site VPN between 2 Cisco Routers
- IPv4 Subnetting Notes
- Types of IDS Alerts
- How to run vSphere using SSH tunnelling
Bourne - Different ways to execute a script
Sunday, 14 December 2008 21:27
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]
sh [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 scenerio when you were making changes to your profile variables and wanted to activate the changes without logging off.
. [script]
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.
exec [script]